Package: prayer / 1.3.3-dfsg1-3

ipv6_v6only.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--- 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);