Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Upmerge 25032024 #167

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/l2_packet/l2_packet_zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ int l2_packet_get_ip_addr(struct l2_packet_data *l2, char *buf, size_t len)
#ifdef CONFIG_NET_IPV4
char addr_buf[NET_IPV4_ADDR_LEN];
os_strlcpy(buf, net_addr_ntop(AF_INET,
&l2->iface->config.ip.ipv4->unicast[0].address.in_addr.s_addr,
&l2->iface->config.ip.ipv4->unicast[0].ipv4.address.in_addr.s_addr,
addr_buf, sizeof(addr_buf)), len);
return 0;
#else
Expand Down
10 changes: 0 additions & 10 deletions src/utils/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1302,13 +1302,3 @@ void forced_memzero(void *ptr, size_t len)
if (len)
forced_memzero_val = ((u8 *) ptr)[0];
}

#ifdef CONFIG_ZEPHYR
#include <zephyr/net/net_ip.h>
extern char *inet_ntoa(struct in_addr in)
{
char addr[NET_IPV4_ADDR_LEN];

return net_addr_ntop(AF_INET, (const void *)&in, addr, NET_IPV4_ADDR_LEN);
}
#endif
4 changes: 1 addition & 3 deletions src/utils/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,7 @@ void int_array_concat(int **res, const int *a);
void int_array_sort_unique(int *a);
void int_array_add_unique(int **res, int a);

#ifdef CONFIG_ZEPHYR
char *inet_ntoa(struct in_addr in);
#else
#ifndef CONFIG_ZEPHYR
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#endif

Expand Down
Loading