changeset 7777:e3425726b80d

zeroconf: don't allow ipv6 addresses
author Alexander Solovyov <piranha@piranha.org.ua>
date Sun, 15 Feb 2009 20:18:29 +0200
parents 34ff1a1b5dd7
children 82f7145b304c
files hgext/zeroconf/__init__.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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