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

Commit

Permalink
[nrf noup] utils: common: inet_ntoa is now provided by Zephyr
Browse files Browse the repository at this point in the history
So there's no need to provide an implementation. See
4edb9017c229c34d111ec77d3c9105f8e77448f5.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
  • Loading branch information
gmarull committed Apr 30, 2024
1 parent 028aaed commit 62d2ace
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
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

0 comments on commit 62d2ace

Please sign in to comment.