lib/replace/wscript: make sure IPV6_V6ONLY is available for IPv6 support
[ira/wip.git] / lib / replace / wscript
index 9f51431e8c9e14f269229046fd6d5d08c244a166..cfb4181066503dc0798815a3fbd2672023373d0b 100644 (file)
@@ -129,6 +129,14 @@ def configure(conf):
                          const char *es = gai_strerror(ret);
                        }
                        freeaddrinfo(ai);
+                       {
+                          int val = 1;
+                          #ifdef HAVE_LINUX_IPV6_V6ONLY_26
+                          #define IPV6_V6ONLY 26
+                          #endif
+                          ret = setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
+                                           (const void *)&val, sizeof(val));
+                       }
                        ''',
                     define='HAVE_IPV6',
                     lib='nsl socket',