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
1ae4fce6
Commit
1ae4fce6
authored
Dec 07, 2015
by
Brian May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix logging with pf method and Python 3.5
parent
118171af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
pf.py
sshuttle/methods/pf.py
+6
-5
test_methods_pf.py
sshuttle/tests/test_methods_pf.py
+1
-0
No files found.
sshuttle/methods/pf.py
View file @
1ae4fce6
...
@@ -158,12 +158,13 @@ class Method(BaseMethod):
...
@@ -158,12 +158,13 @@ class Method(BaseMethod):
argv
=
(
sock
.
family
,
socket
.
IPPROTO_TCP
,
argv
=
(
sock
.
family
,
socket
.
IPPROTO_TCP
,
peer
[
0
]
.
encode
(
"ASCII"
),
peer
[
1
],
peer
[
0
]
.
encode
(
"ASCII"
),
peer
[
1
],
proxy
[
0
]
.
encode
(
"ASCII"
),
proxy
[
1
])
proxy
[
0
]
.
encode
(
"ASCII"
),
proxy
[
1
])
pfile
.
write
(
b
"QUERY_PF_NAT
%
d,
%
d,
%
s,
%
d,
%
s,
%
d
\n
"
%
argv
)
out_line
=
b
"QUERY_PF_NAT
%
d,
%
d,
%
s,
%
d,
%
s,
%
d
\n
"
%
argv
pfile
.
write
(
out_line
)
pfile
.
flush
()
pfile
.
flush
()
line
=
pfile
.
readline
()
in_
line
=
pfile
.
readline
()
debug2
(
b
"QUERY_PF_NAT
%
d,
%
d,
%
s,
%
d,
%
s,
%
d"
%
argv
+
b
' > '
+
line
)
debug2
(
out_line
.
decode
(
"ASCII"
)
+
' > '
+
in_line
.
decode
(
"ASCII"
)
)
if
line
.
startswith
(
b
'QUERY_PF_NAT_SUCCESS '
):
if
in_
line
.
startswith
(
b
'QUERY_PF_NAT_SUCCESS '
):
(
ip
,
port
)
=
line
[
21
:]
.
split
(
b
','
)
(
ip
,
port
)
=
in_
line
[
21
:]
.
split
(
b
','
)
return
(
ip
.
decode
(
"ASCII"
),
int
(
port
))
return
(
ip
.
decode
(
"ASCII"
),
int
(
port
))
return
sock
.
getsockname
()
return
sock
.
getsockname
()
...
...
sshuttle/tests/test_methods_pf.py
View file @
1ae4fce6
...
@@ -12,6 +12,7 @@ def test_get_supported_features():
...
@@ -12,6 +12,7 @@ def test_get_supported_features():
assert
not
features
.
udp
assert
not
features
.
udp
@
patch
(
'sshuttle.helpers.verbose'
,
new
=
3
)
def
test_get_tcp_dstip
():
def
test_get_tcp_dstip
():
sock
=
Mock
()
sock
=
Mock
()
sock
.
getpeername
.
return_value
=
(
"127.0.0.1"
,
1024
)
sock
.
getpeername
.
return_value
=
(
"127.0.0.1"
,
1024
)
...
...
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