mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-04-24 11:19:00 +02:00
If IPv4 bind but IPv6 succeeds don't error.
This commit is contained in:
parent
a33f6199c4
commit
c013386ecb
@ -209,7 +209,15 @@ class MultiListener:
|
|||||||
if self.v6:
|
if self.v6:
|
||||||
self.v6.listen(backlog)
|
self.v6.listen(backlog)
|
||||||
if self.v4:
|
if self.v4:
|
||||||
|
try:
|
||||||
self.v4.listen(backlog)
|
self.v4.listen(backlog)
|
||||||
|
except socket.error, e:
|
||||||
|
# on some systems v4 bind will fail if the v6 suceeded,
|
||||||
|
# in this case the v6 socket will receive v4 too.
|
||||||
|
if e.errno == errno.EADDRINUSE and self.v6:
|
||||||
|
self.v4 = None
|
||||||
|
else:
|
||||||
|
raise e
|
||||||
|
|
||||||
def bind(self, address_v6, address_v4):
|
def bind(self, address_v6, address_v4):
|
||||||
if address_v6 and self.v6:
|
if address_v6 and self.v6:
|
||||||
|
Loading…
Reference in New Issue
Block a user