don't try to use GUPnP-IGD when we use an IPv6 address
This commit is contained in:
parent
48a2486d60
commit
cb36bc7abe
1 changed files with 10 additions and 4 deletions
|
@ -421,6 +421,15 @@ class ConnectionSocks5Bytestream(ConnectionBytestream):
|
||||||
self.connection.send(iq)
|
self.connection.send(iq)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
my_ip = self.peerhost[0]
|
||||||
|
|
||||||
|
# check if we are connected with an IPv4 address
|
||||||
|
try:
|
||||||
|
socket.inet_aton(my_ip)
|
||||||
|
except socket.error as e:
|
||||||
|
self.connection.send(iq)
|
||||||
|
return
|
||||||
|
|
||||||
def ip_is_local(ip):
|
def ip_is_local(ip):
|
||||||
if '.' not in ip:
|
if '.' not in ip:
|
||||||
# it's an IPv6
|
# it's an IPv6
|
||||||
|
@ -439,9 +448,6 @@ class ConnectionSocks5Bytestream(ConnectionBytestream):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
my_ip = self.peerhost[0]
|
|
||||||
|
|
||||||
if not ip_is_local(my_ip):
|
if not ip_is_local(my_ip):
|
||||||
self.connection.send(iq)
|
self.connection.send(iq)
|
||||||
return
|
return
|
||||||
|
@ -475,7 +481,7 @@ class ConnectionSocks5Bytestream(ConnectionBytestream):
|
||||||
cleanup_gupnp()
|
cleanup_gupnp()
|
||||||
|
|
||||||
def fail(s, error, proto, ext_ip, local_ip, local_port, desc):
|
def fail(s, error, proto, ext_ip, local_ip, local_port, desc):
|
||||||
log.debug('Got GUPnP-IGD error : %s', str(error))
|
log.debug('Got GUPnP-IGD error')
|
||||||
self.connection.send(iq)
|
self.connection.send(iq)
|
||||||
cleanup_gupnp()
|
cleanup_gupnp()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue