[libvirt] [PATCH 1/4] tests: Fix virnetsockettest on FreeBSD

Andrea Bolognani abologna at redhat.com
Fri Apr 27 15:21:20 UTC 2018


FreeBSD doesn't let IPv4 clients to connect to IPv6 sockets,
so one of our test cases has to be compiled out there.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 tests/virnetsockettest.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index 9f9a243484..d39481067e 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -470,9 +470,19 @@ mymain(void)
         if (virTestRun("Socket TCP/IPv4+IPv6 Accept", testSocketTCPAccept, &tcpData) < 0)
             ret = -1;
 
+        /* From FreeBSD's inet6(4):
+         *
+         *   By default, FreeBSD does not route IPv4 traffic to AF_INET6
+         *   sockets.  The default behavior intentionally violates RFC2553
+         *   for security reasons.  Listen to two sockets if you want to
+         *   accept both IPv4 and IPv6 traffic.
+         *
+         * So this test will never work on FreeBSD, and need to skip it. */
+# ifndef __FreeBSD__
         tcpData.cnode = "::1";
         if (virTestRun("Socket TCP/IPv4+IPv6 Accept", testSocketTCPAccept, &tcpData) < 0)
             ret = -1;
+# endif /* __FreeBSD__ */
     }
 #endif
 
-- 
2.14.3




More information about the libvir-list mailing list