zeroconf: don't allow ipv6 addresses
authorAlexander Solovyov <piranha@piranha.org.ua>
Sun, 15 Feb 2009 20:18:29 +0200
changeset 7777 e3425726b80d
parent 7776 34ff1a1b5dd7
child 7778 82f7145b304c
zeroconf: don't allow ipv6 addresses
hgext/zeroconf/__init__.py
--- a/hgext/zeroconf/__init__.py	Mon Feb 16 01:41:01 2009 +0100
+++ b/hgext/zeroconf/__init__.py	Sun Feb 15 20:18:29 2009 +0200
@@ -52,7 +52,7 @@
 
     # Generic method, sometimes gives useless results
     dumbip = socket.gethostbyaddr(socket.gethostname())[2][0]
-    if not dumbip.startswith('127.'):
+    if not dumbip.startswith('127.') and ':' not in dumbip:
         return dumbip
 
     # works elsewhere, but actually sends a packet