diff mbox

[OSSTEST,02/16] rump-test-net: setsockopt V6ONLY off

Message ID 1475858096-16123-3-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson Oct. 7, 2016, 4:34 p.m. UTC
NetBSD (unlike Linux) has the V6ONLY socket option turned on by
default.  So to work in the rump kernel environment when tested with
IPv4 we need to adjust this setting.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 rump-test-net.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/rump-test-net.c b/rump-test-net.c
index 96dbb1c..486a261 100644
--- a/rump-test-net.c
+++ b/rump-test-net.c
@@ -21,6 +21,10 @@  int main(int argc, const char *const *argv) {
     master = socket(AF_INET6,SOCK_STREAM,0);
     if (master<0) { perror("socket"); exit(-1); }
 
+    int no = 0;
+    r = setsockopt(master, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&no, sizeof(no));
+    if (r<0) { perror("IPV6_V6ONLY"); exit(-1); }
+
     int port = atoi(argv[1]);
 
     memset(&sin6,0,sizeof(sin6));