From 073f530bfe0b21bb7c94cd047af94f0463dfe96d Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 8 Dec 2023 01:31:35 +1100 Subject: treewide: Add IN4ADDR_ANY_INIT macro We already define IN4ADDR_LOOPBACK_INIT to initialise a struct in_addr to the loopback address, make a similar one for the unspecified / any address. This avoids messying things with the internal structure of struct in_addr where we don't care about it. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- icmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'icmp.c') 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; -- cgit v1.2.3