diff --git a/test/net.c b/test/net.c index 6ece560f0..074b5639b 100644 --- a/test/net.c +++ b/test/net.c @@ -24,7 +24,7 @@ static bool ipv6_handler(const char *ifname, const struct sa *sa, void *arg) } -static bool ipv6_supported(void) +bool test_ipv6_supported(void) { bool supp = false; @@ -51,7 +51,7 @@ int test_net_dst_source_addr_get(void) TEST_ASSERT(sa_is_loopback(&ip)); - if (ipv6_supported()) { + if (test_ipv6_supported()) { sa_init(&dst, AF_INET6); sa_init(&ip, AF_UNSPEC); diff --git a/test/tcp.c b/test/tcp.c index 0e6d5254e..ac921921d 100644 --- a/test/tcp.c +++ b/test/tcp.c @@ -277,8 +277,10 @@ int test_tcp_tos(void) err = tcp_tos("127.0.0.1"); TEST_ERR(err); - err = tcp_tos("::1"); - TEST_ERR(err); + if (test_ipv6_supported()) { + err = tcp_tos("::1"); + TEST_ERR(err); + } out: return err; diff --git a/test/test.h b/test/test.h index 4b6ac9bff..ef4f8626c 100644 --- a/test/test.h +++ b/test/test.h @@ -405,6 +405,7 @@ int test_load_file(struct mbuf *mb, const char *filename); int test_write_file(struct mbuf *mb, const char *filename); void test_set_datapath(const char *path); const char *test_datapath(void); +bool test_ipv6_supported(void); /* diff --git a/test/udp.c b/test/udp.c index 4887692a0..fd8872fab 100644 --- a/test/udp.c +++ b/test/udp.c @@ -274,8 +274,10 @@ int test_udp_tos(void) err = udp_tos("127.0.0.1"); TEST_ERR(err); - err = udp_tos("::1"); - TEST_ERR(err); + if (test_ipv6_supported()) { + err = udp_tos("::1"); + TEST_ERR(err); + } out: return err;