From 546332786cee921213fc59db6207be23c2d70208 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 8 Dec 2023 01:31:34 +1100 Subject: treewide: Use IN4ADDR_LOOPBACK_INIT more widely We already define IN4ADDR_LOOPBACK_INIT to initialise a struct in_addr to the loopback address without delving into its internals. However there are some places we don't use it, and explicitly look at the internal structure of struct in_addr, which we generally want to avoid. Use the define more widely to avoid that. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tcp.c') diff --git a/tcp.c b/tcp.c index f62b910..8e3a4c5 100644 --- a/tcp.c +++ b/tcp.c @@ -2976,7 +2976,7 @@ static void tcp_ns_sock_init4(const struct ctx *c, in_port_t port) .port = port + c->tcp.fwd_out.delta[port], .pif = PIF_SPLICE, }; - struct in_addr loopback = { htonl(INADDR_LOOPBACK) }; + struct in_addr loopback = IN4ADDR_LOOPBACK_INIT; int s; ASSERT(c->mode == MODE_PASTA); -- cgit v1.2.3