Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sshuttle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pub
sshuttle
Commits
534ad8df
Commit
534ad8df
authored
May 09, 2020
by
Mark Heiges
Committed by
Brian May
May 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crash triggered by port scans closing socket
parent
535eb629
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
pf.py
sshuttle/methods/pf.py
+9
-1
ssnet.py
sshuttle/ssnet.py
+4
-1
No files found.
sshuttle/methods/pf.py
View file @
534ad8df
...
...
@@ -3,6 +3,7 @@ import sys
import
platform
import
re
import
socket
import
errno
import
struct
import
subprocess
as
ssubprocess
import
shlex
...
...
@@ -423,7 +424,14 @@ class Method(BaseMethod):
def
get_tcp_dstip
(
self
,
sock
):
pfile
=
self
.
firewall
.
pfile
try
:
peer
=
sock
.
getpeername
()
except
socket
.
error
:
_
,
e
=
sys
.
exc_info
()[:
2
]
if
e
.
args
[
0
]
==
errno
.
EINVAL
:
debug2
(
"get_tcp_dstip error: sock.getpeername()
%
s
\n
socket is probably closed.
\n
"
%
e
)
return
sock
.
getsockname
()
proxy
=
sock
.
getsockname
()
argv
=
(
sock
.
family
,
socket
.
IPPROTO_TCP
,
...
...
sshuttle/ssnet.py
View file @
534ad8df
...
...
@@ -96,7 +96,10 @@ def _try_peername(sock):
return
'
%
s:
%
s'
%
(
pn
[
0
],
pn
[
1
])
except
socket
.
error
:
_
,
e
=
sys
.
exc_info
()[:
2
]
if
e
.
args
[
0
]
not
in
(
errno
.
ENOTCONN
,
errno
.
ENOTSOCK
):
if
e
.
args
[
0
]
==
errno
.
EINVAL
:
debug2
(
"_try_peername error: sock.getpeername()
%
s
\n
socket is probably closed.
\n
"
%
e
)
pass
elif
e
.
args
[
0
]
not
in
(
errno
.
ENOTCONN
,
errno
.
ENOTSOCK
):
raise
except
AttributeError
:
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment