Skip to content

Commit 502b36e

Browse files
normanrbrianmay
authored andcommitted
Add tproxy udp port mark filter that was missed in sshuttle#144, fixes sshuttle#367.
1 parent fe1df00 commit 502b36e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sshuttle/methods/tproxy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ def _ipt_proto_ports(proto, fport, lport):
244244
else:
245245
_ipt('-A', mark_chain, '-j', 'MARK', '--set-mark', '1',
246246
'--dest', '%s/%s' % (snet, swidth),
247-
'-m', 'udp', '-p', 'udp')
247+
'-m', 'udp',
248+
*udp_ports)
248249
_ipt('-A', tproxy_chain, '-j', 'TPROXY',
249250
'--tproxy-mark', '0x1/0x1',
250251
'--dest', '%s/%s' % (snet, swidth),

tests/client/test_methods_tproxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_setup_firewall(mock_ipt_chain_exists, mock_ipt_ttl, mock_ipt):
168168
'--on-port', '1024'),
169169
call(AF_INET6, 'mangle', '-A', 'sshuttle-m-1024', '-j', 'MARK',
170170
'--set-mark', '1', '--dest', u'2404:6800:4004:80c::/64',
171-
'-m', 'udp', '-p', 'udp'),
171+
'-m', 'udp', '-p', 'udp', '--dport', '8000:9000'),
172172
call(AF_INET6, 'mangle', '-A', 'sshuttle-t-1024', '-j', 'TPROXY',
173173
'--tproxy-mark', '0x1/0x1', '--dest', u'2404:6800:4004:80c::/64',
174174
'-m', 'udp', '-p', 'udp', '--dport', '8000:9000',

0 commit comments

Comments
 (0)