aboutgitcodebugslistschat
diff options
context:
space:
mode:
-rw-r--r--icmp.c2
-rw-r--r--util.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/icmp.c b/icmp.c
index a1de8ae..2a15d25 100644
--- a/icmp.c
+++ b/icmp.c
@@ -169,7 +169,7 @@ int icmp_tap_handler(const struct ctx *c, uint8_t pif, int af,
if (af == AF_INET) {
struct sockaddr_in sa = {
.sin_family = AF_INET,
- .sin_addr = { .s_addr = htonl(INADDR_ANY) },
+ .sin_addr = IN4ADDR_ANY_INIT,
};
union icmp_epoll_ref iref;
struct icmphdr *ih;
diff --git a/util.h b/util.h
index 9446ea7..fb8c3f1 100644
--- a/util.h
+++ b/util.h
@@ -122,6 +122,9 @@
(((struct in_addr *)(a))->s_addr == ((struct in_addr *)b)->s_addr)
#define IN4ADDR_LOOPBACK_INIT \
{ .s_addr = htonl_constant(INADDR_LOOPBACK) }
+#define IN4ADDR_ANY_INIT \
+ { .s_addr = htonl_constant(INADDR_ANY) }
+
#define NS_FN_STACK_SIZE (RLIMIT_STACK_VAL * 1024 / 8)
int do_clone(int (*fn)(void *), char *stack_area, size_t stack_size, int flags,