zeroconf: don't allow ipv6 addresses

This commit is contained in:
Alexander Solovyov 2009-02-15 20:18:29 +02:00
parent ccfb3c24ba
commit 505e1dc92b

View File

@ -52,7 +52,7 @@ def getip():
# 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