Skip to content

Commit aaa6062

Browse files
committed
Remove IPFW support.
This is no longer used by modern MacOSX and not getting tested. It also required a do_wait() function which was a complication for sshuttle as a whole. Can get resurrected if required.
1 parent da4ce19 commit aaa6062

File tree

7 files changed

+7
-277
lines changed

7 files changed

+7
-277
lines changed

README.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,9 @@ Client side Requirements
4343
| | | * IPv6 TCP + |
4444
| | | * IPv6 UDP + |
4545
+-------+--------+------------+-----------------------------------------------+
46-
| BSD | IPFW | * IPv4 TCP | Your kernel needs to be compiled with |
47-
| | | | `IPFIREWALL_FORWARD` and you need to have ipfw|
48-
| | | | available. |
49-
+-------+--------+------------+-----------------------------------------------+
5046
| MacOS | PF | * IPv4 TCP + You need to have the pfctl command. |
5147
+-------+--------+------------+-----------------------------------------------+
5248

53-
The IPFW method is depreciated. It was originally required for MacOS support,
54-
however is no longer maintained. It is likely to get removed from future
55-
versions of sshuttle.
56-
5749

5850
Server side Requirements
5951
------------------------

sshuttle/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def parse_list(list):
119119
N,auto-nets automatically determine subnets to route
120120
dns capture local DNS requests and forward to the remote DNS server
121121
ns-hosts= capture and forward remote DNS requests to the following servers
122-
method= auto, nat, tproxy, pf or ipfw
122+
method= auto, nat, tproxy or pf
123123
python= path to python interpreter on the remote server
124124
r,remote= ssh hostname (and optional username) of remote sshuttle server
125125
x,exclude= exclude this subnet (can be used more than once)
@@ -181,7 +181,7 @@ def parse_list(list):
181181
includes = parse_subnet_file(opt.subnets)
182182
if not opt.method:
183183
method_name = "auto"
184-
elif opt.method in ["auto", "nat", "tproxy", "ipfw", "pf"]:
184+
elif opt.method in ["auto", "nat", "tproxy", "pf"]:
185185
method_name = opt.method
186186
else:
187187
o.fatal("method_name %s not supported" % opt.method)

sshuttle/firewall.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,11 @@ def main(method_name, syslog):
178178
try:
179179
debug1('firewall manager: setting up.\n')
180180

181-
do_wait = None
182181
nslist_v6 = [i for i in nslist if i[0] == socket.AF_INET6]
183182
subnets_v6 = [i for i in subnets if i[0] == socket.AF_INET6]
184183
if port_v6 > 0:
185184
debug2('firewall manager: setting up IPv6.\n')
186-
do_wait = method.setup_firewall(
185+
method.setup_firewall(
187186
port_v6, dnsport_v6, nslist_v6,
188187
socket.AF_INET6, subnets_v6, udp)
189188
elif len(subnets_v6) > 0:
@@ -193,7 +192,7 @@ def main(method_name, syslog):
193192
subnets_v4 = [i for i in subnets if i[0] == socket.AF_INET]
194193
if port_v4 > 0:
195194
debug2('firewall manager: setting up IPv4.\n')
196-
do_wait = method.setup_firewall(
195+
method.setup_firewall(
197196
port_v4, dnsport_v4, nslist_v4,
198197
socket.AF_INET, subnets_v4, udp)
199198
elif len(subnets_v4) > 0:
@@ -213,8 +212,6 @@ def main(method_name, syslog):
213212
# to stay running so that we don't need a *second* password
214213
# authentication at shutdown time - that cleanup is important!
215214
while 1:
216-
if do_wait is not None:
217-
do_wait()
218215
line = stdin.readline(128)
219216
if line.startswith('HOST '):
220217
(name, ip) = line[5:].strip().split(',', 1)

sshuttle/methods/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,12 @@ def get_method(method_name):
8686

8787

8888
def get_auto_method():
89-
if _program_exists('ipfw'):
90-
method_name = "ipfw"
91-
elif _program_exists('iptables'):
89+
if _program_exists('iptables'):
9290
method_name = "nat"
9391
elif _program_exists('pfctl'):
9492
method_name = "pf"
9593
else:
9694
raise Fatal(
97-
"can't find either ipfw, iptables or pfctl; check your PATH")
95+
"can't find either iptables or pfctl; check your PATH")
9896

9997
return get_method(method_name)

sshuttle/methods/ipfw.py

Lines changed: 0 additions & 237 deletions
This file was deleted.

sshuttle/sshuttle.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ conflicts between client and server.
227227

228228
Unlike most VPNs, sshuttle forwards sessions, not packets.
229229
That is, it uses kernel transparent proxying (`iptables
230-
REDIRECT` rules on Linux, or `ipfw fwd` rules on BSD) to
230+
REDIRECT` rules on Linux) to
231231
capture outgoing TCP sessions, then creates entirely
232232
separate TCP sessions out to the original destination at
233233
the other end of the tunnel.
@@ -256,24 +256,6 @@ between the two separate streams, so a tcp-based tunnel is
256256
fine.
257257

258258

259-
# BUGS
260-
261-
On MacOS 10.6 (at least up to 10.6.6), your network will
262-
stop responding about 10 minutes after the first time you
263-
start sshuttle, because of a MacOS kernel bug relating to
264-
arp and the net.inet.ip.scopedroute sysctl. To fix it,
265-
just switch your wireless off and on. Sshuttle makes the
266-
kernel setting it changes permanent, so this won't happen
267-
again, even after a reboot.
268-
269-
On MacOS, sshuttle will set the kernel boot flag
270-
net.inet.ip.scopedroute to 0, which interferes with OS X
271-
Internet Sharing and some VPN clients. To reset this flag,
272-
you can remove any reference to net.inet.ip.scopedroute from
273-
/Library/Preferences/SystemConfiguration/com.apple.Boot.plist
274-
and reboot.
275-
276-
277259
# SEE ALSO
278260

279261
`ssh`(1), `python`(1)

sshuttle/tests/test_firewall.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ def test_main(mock_get_method, mock_setup_daemon, mock_rewrite_etc_hosts):
9797
2,
9898
[(2, 24, False, u'1.2.3.0'), (2, 32, True, u'1.2.3.66')],
9999
True),
100-
call().setup_firewall()(),
101-
call().setup_firewall()(),
102100
call().setup_firewall(1024, 0, [], 10, [], True),
103101
call().setup_firewall(1025, 0, [], 2, [], True),
104102
]

0 commit comments

Comments
 (0)