diff --git a/tests/contrib/test_net.c b/tests/contrib/test_net.c index 95833625e..ff028eb99 100644 --- a/tests/contrib/test_net.c +++ b/tests/contrib/test_net.c @@ -40,10 +40,7 @@ const int TIMEOUT_SHORT = 500; static struct sockaddr_storage addr_local(void) { struct sockaddr_storage addr = { 0 }; - struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&addr; - - addr6->sin6_family = AF_INET6; - addr6->sin6_addr = in6addr_loopback; + sockaddr_set(&addr, AF_INET, "127.0.0.1", 0); return addr; }