Skip to content

Commit

Permalink
shortcut out for ipv6 (not handled yet)
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@14275 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 25, 2016
1 parent 4b7d2a9 commit dbc77a1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/xpra/net/net_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ def get_iface(ip):
log("get_iface(%s)", ip)
if not ip:
return None
if ip.find(":")>=0:
#ipv6?
return None
if any(x for x in ip if (".:0123456789").find(x)<0):
#extra characters, assume this is a hostname:
try:
Expand All @@ -125,17 +128,11 @@ def get_iface(ip):
for i, x in enumerate(v):
family, socktype, proto, canonname, sockaddr = x
log("get_iface(%s) [%i]=%s", ip, i, (family, socktype, proto, canonname, sockaddr))
if ip.find(":")>0 and family==socket.AF_INET6:
break
elif family==socket.AF_INET:
if family==socket.AF_INET:
break
log("get_iface(%s) sockaddr=%s", ip, sockaddr)
ip = sockaddr[0]

if ip.find(":")>=0:
#ipv6?
return None

ip_parts = ip.split(".")
if len(ip_parts)!=4:
return None
Expand Down

0 comments on commit dbc77a1

Please sign in to comment.