summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Vieira <vieira+github@yubo.be>2018-10-22 21:31:29 +0100
committerBrian May <brian@linuxpenguins.xyz>2018-10-23 07:31:29 +1100
commit7a54d12f80117a4f2eb68a8d9027a0b7176e7625 (patch)
treeec0d7af32bcb05f5eb6b6366d70b1b2147b9b7d1
parentd4bbf3b68d26cae09a005bb29094fe3b792a78d6 (diff)
Fixes support for OpenBSD (6.1+) (#282)
* Fixes support for OpenBSD (6.1+) As reported in #219, new versions of OpenBSD ship with a different pfioc_rule struct. This commit adjusts the offset to match the new struct. * Fixes tests for OpenBSD 6.1+
-rw-r--r--sshuttle/methods/pf.py2
-rw-r--r--tests/client/test_methods_pf.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/sshuttle/methods/pf.py b/sshuttle/methods/pf.py
index d1f3bd6..d80678f 100644
--- a/sshuttle/methods/pf.py
+++ b/sshuttle/methods/pf.py
@@ -261,7 +261,7 @@ class OpenBsd(Generic):
("proto_variant", c_uint8),
("direction", c_uint8)]
- self.pfioc_rule = c_char * 3400
+ self.pfioc_rule = c_char * 3416
self.pfioc_natlook = pfioc_natlook
super(OpenBsd, self).__init__()
diff --git a/tests/client/test_methods_pf.py b/tests/client/test_methods_pf.py
index e965c62..ebe527f 100644
--- a/tests/client/test_methods_pf.py
+++ b/tests/client/test_methods_pf.py
@@ -403,8 +403,8 @@ def test_setup_firewall_openbsd(mock_pf_get_dev, mock_ioctl, mock_pfctl):
None)
assert mock_ioctl.mock_calls == [
- call(mock_pf_get_dev(), 0xcd48441a, ANY),
- call(mock_pf_get_dev(), 0xcd48441a, ANY),
+ call(mock_pf_get_dev(), 0xcd58441a, ANY),
+ call(mock_pf_get_dev(), 0xcd58441a, ANY),
]
assert mock_pfctl.mock_calls == [
call('-s Interfaces -i lo -v'),
@@ -451,8 +451,8 @@ def test_setup_firewall_openbsd(mock_pf_get_dev, mock_ioctl, mock_pfctl):
False,
None)
assert mock_ioctl.mock_calls == [
- call(mock_pf_get_dev(), 0xcd48441a, ANY),
- call(mock_pf_get_dev(), 0xcd48441a, ANY),
+ call(mock_pf_get_dev(), 0xcd58441a, ANY),
+ call(mock_pf_get_dev(), 0xcd58441a, ANY),
]
assert mock_pfctl.mock_calls == [
call('-s Interfaces -i lo -v'),