aboutsummaryrefslogtreecommitdiffstats
path: root/main/knot/test_net.patch
blob: 70a1ba751dd15dd64b615d92e607a9b1233007f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;
 }