summaryrefslogtreecommitdiffstats
path: root/Sshuttle VPN.app/Contents/Resources/sshuttle/ssnet.py
diff options
context:
space:
mode:
authorAvery Pennarun <apenwarr@gmail.com>2012-01-08 19:16:05 -0500
committerAvery Pennarun <apenwarr@gmail.com>2012-01-08 19:16:05 -0500
commitd5c3aa61b8b77d3b12647bb15a83ba51a5f4d312 (patch)
treef2be45bae2de7bf76bd25e3120228747372452c9 /Sshuttle VPN.app/Contents/Resources/sshuttle/ssnet.py
parent5b57de24041a4c184197fa369859dcaf95c1bdf4 (diff)
MacOS precompiled app package for sshuttle-0.60sshuttle-0.60-macos-bin
Diffstat (limited to 'Sshuttle VPN.app/Contents/Resources/sshuttle/ssnet.py')
-rw-r--r--Sshuttle VPN.app/Contents/Resources/sshuttle/ssnet.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Sshuttle VPN.app/Contents/Resources/sshuttle/ssnet.py b/Sshuttle VPN.app/Contents/Resources/sshuttle/ssnet.py
index b6d73c2..a636ce1 100644
--- a/Sshuttle VPN.app/Contents/Resources/sshuttle/ssnet.py
+++ b/Sshuttle VPN.app/Contents/Resources/sshuttle/ssnet.py
@@ -152,6 +152,17 @@ class SockWrapper:
debug3('%r: fixed connect result: %s\n' % (self, e))
if e.args[0] in [errno.EINPROGRESS, errno.EALREADY]:
pass # not connected yet
+ elif e.args[0] == 0:
+ # connected successfully (weird Linux bug?)
+ # Sometimes Linux seems to return EINVAL when it isn't
+ # invalid. This *may* be caused by a race condition
+ # between connect() and getsockopt(SO_ERROR) (ie. it
+ # finishes connecting in between the two, so there is no
+ # longer an error). However, I'm not sure of that.
+ #
+ # I did get at least one report that the problem went away
+ # when we added this, however.
+ self.connect_to = None
elif e.args[0] == errno.EISCONN:
# connected successfully (BSD)
self.connect_to = None