← Back to team overview

zeya team mailing list archive

[PATCH] zeya.py: set IPV6_V6ONLY to 0 on the server socket.

 

Recent Debian systems have ipv6only set to 1, disabling IPv4-mapped
address support. Set it back to 0 on the server socket to restore IPv4
access.
---
 zeya.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/zeya.py b/zeya.py
index c06043f..7ce4224 100755
--- a/zeya.py
+++ b/zeya.py
@@ -89,6 +89,11 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
     if socket.has_ipv6:
         address_family = socket.AF_INET6
 
+    def server_bind(self):
+        if socket.has_ipv6:
+            self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
+        HTTPServer.server_bind(self)
+
 user_pass_regexp = re.compile('([^:]):(.*)$')
 def split_user_pass(data):
     """ Split the given data into user and password. """
-- 
1.6.6.rc2.5.g49666




Follow ups