Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Blame | Last modification | View Log | RSS feed

--- a/lib/os.c
+++ b/lib/os.c
@@ -217,6 +217,15 @@ int *os_bind_inet_socket(unsigned long p
             close(sockfd);
             return(NIL);
         }
+#if defined(IPV6_V6ONLY) && defined(AF_INET6)
+        if (ai->ai_family == AF_INET6) {
+          if (setsockopt
+             (sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (void *) &optval, sizeof(int)))
+            log_misc(("[os_bind_inet_socket()] setsockopt() failed: "
+                       "couldn't set IPV6_V6ONLY: %s"), strerror(errno));
+        }
+#endif
+
         
         /* bind() as Internet domain socket */
         memcpy(&serv_addr, ai->ai_addr, ai->ai_addrlen);