X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=src%2Fnet_setup.c;fp=src%2Fnet_setup.c;h=f2621f3b92e6f87c0f2afcbcbf742b4ba22f7aa6;hb=dc0e52cb3e42620c3139e713b373d130aa30b698;hp=2cd021111a204aebb37b4e0273a12ec75e19beed;hpb=43ffcfc3c3fcd8088a77e9a2ac9cc4013c466158;p=meshlink diff --git a/src/net_setup.c b/src/net_setup.c index 2cd02111..f2621f3b 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -273,15 +273,13 @@ static bool add_listen_address(meshlink_handle_t *mesh, char *address, bool bind } } - struct addrinfo *ai, hint = {}; - - hint.ai_family = addressfamily; - - hint.ai_socktype = SOCK_STREAM; - - hint.ai_protocol = IPPROTO_TCP; - - hint.ai_flags = AI_PASSIVE; + struct addrinfo *ai; + struct addrinfo hint = { + .ai_family = addressfamily, + .ai_socktype = SOCK_STREAM, + .ai_protocol = IPPROTO_TCP, + .ai_flags = AI_PASSIVE, + }; int err = getaddrinfo(address && *address ? address : NULL, port, &hint, &ai);