summaryrefslogtreecommitdiffstats
path: root/tests/client/test_firewall.py
diff options
context:
space:
mode:
authorScott Kuhl <kuhl@mtu.edu>2021-05-31 23:33:55 -0400
committerScott Kuhl <kuhl@mtu.edu>2021-07-12 11:24:29 -0400
commitbc065e368d9888a2f5816e5a498dfe33cb5dca8a (patch)
tree283d1006e8bb52aeb3f2348a7ad7b0fb817400fd /tests/client/test_firewall.py
parent6ae0b51c61b43d7ac76b59248da0d2c127308c71 (diff)
Remove ttl hack & require -r option.
Previously, it was possible to run sshuttle locally without using ssh and connecting to a remote server. In this configuration, traffic was redirected to the sshuttle server running on the localhost. However, the firewall needed to distinguish between traffic leaving the sshuttle server and traffic that originated from the machine that still needed to be routed through the sshuttle server. The TTL of the packets leaving the sshuttle server were manipulated to indicate to the firewall what should happen. The TTL was adjusted for all packets leaving the sshuttle server (even if it wasn't necessary because the server and client were running on different machines). Changing the TTL caused trouble and some machines, and the --ttl option was added as a workaround to change how the TTL was set for traffic leaving sshuttle. All of this added complexity to the code for a feature (running the server on localhost) that is likely only used for testing and rarely used by others. This commit updates the associated documentation, but doesn't fully fix the ipfw method since I am unable to test that. This change will also make sshuttle fail to work if -r is used to specify a localhost. Pull request #610 partially addresses that issue. For example, see: #240, #490, #660, #606.
Diffstat (limited to 'tests/client/test_firewall.py')
-rw-r--r--tests/client/test_firewall.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/client/test_firewall.py b/tests/client/test_firewall.py
index 31618d9..d249361 100644
--- a/tests/client/test_firewall.py
+++ b/tests/client/test_firewall.py
@@ -15,7 +15,7 @@ NSLIST
{inet},1.2.3.33
{inet6},2404:6800:4004:80c::33
PORTS 1024,1025,1026,1027
-GO 1 - 63 0x01
+GO 1 - 0x01
HOST 1.2.3.3,existing
""".format(inet=AF_INET, inet6=AF_INET6))
stdout = Mock()
@@ -100,7 +100,7 @@ def test_main(mock_get_method, mock_setup_daemon, mock_rewrite_etc_hosts):
mock_get_method("not_auto").name = "test"
mock_get_method.reset_mock()
- sshuttle.firewall.main("not_auto", False, 63)
+ sshuttle.firewall.main("not_auto", False)
assert mock_rewrite_etc_hosts.mock_calls == [
call({'1.2.3.3': 'existing'}, 1024),
@@ -126,7 +126,7 @@ def test_main(mock_get_method, mock_setup_daemon, mock_rewrite_etc_hosts):
(AF_INET6, 128, True, u'2404:6800:4004:80c::101f', 80, 80)],
True,
None,
- 63, '0x01'),
+ '0x01'),
call().setup_firewall(
1025, 1027,
[(AF_INET, u'1.2.3.33')],
@@ -135,7 +135,7 @@ def test_main(mock_get_method, mock_setup_daemon, mock_rewrite_etc_hosts):
(AF_INET, 32, True, u'1.2.3.66', 8080, 8080)],
True,
None,
- 63, '0x01'),
+ '0x01'),
call().restore_firewall(1024, AF_INET6, True, None),
call().restore_firewall(1025, AF_INET, True, None),
]