1
1
mirror of https://github.com/sshuttle/sshuttle.git synced 2025-04-05 23:08:14 +02:00

Fixes support for OpenBSD (6.1+) ()

* Fixes support for OpenBSD (6.1+)

As reported in , 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+
This commit is contained in:
João Vieira 2018-10-22 21:31:29 +01:00 committed by Brian May
parent d4bbf3b68d
commit 7a54d12f80
2 changed files with 5 additions and 5 deletions
sshuttle/methods
tests/client

View File

@ -261,7 +261,7 @@ class OpenBsd(Generic):
("proto_variant", c_uint8), ("proto_variant", c_uint8),
("direction", c_uint8)] ("direction", c_uint8)]
self.pfioc_rule = c_char * 3400 self.pfioc_rule = c_char * 3416
self.pfioc_natlook = pfioc_natlook self.pfioc_natlook = pfioc_natlook
super(OpenBsd, self).__init__() super(OpenBsd, self).__init__()

View File

@ -403,8 +403,8 @@ def test_setup_firewall_openbsd(mock_pf_get_dev, mock_ioctl, mock_pfctl):
None) None)
assert mock_ioctl.mock_calls == [ assert mock_ioctl.mock_calls == [
call(mock_pf_get_dev(), 0xcd48441a, ANY), call(mock_pf_get_dev(), 0xcd58441a, ANY),
call(mock_pf_get_dev(), 0xcd48441a, ANY), call(mock_pf_get_dev(), 0xcd58441a, ANY),
] ]
assert mock_pfctl.mock_calls == [ assert mock_pfctl.mock_calls == [
call('-s Interfaces -i lo -v'), call('-s Interfaces -i lo -v'),
@ -451,8 +451,8 @@ def test_setup_firewall_openbsd(mock_pf_get_dev, mock_ioctl, mock_pfctl):
False, False,
None) None)
assert mock_ioctl.mock_calls == [ assert mock_ioctl.mock_calls == [
call(mock_pf_get_dev(), 0xcd48441a, ANY), call(mock_pf_get_dev(), 0xcd58441a, ANY),
call(mock_pf_get_dev(), 0xcd48441a, ANY), call(mock_pf_get_dev(), 0xcd58441a, ANY),
] ]
assert mock_pfctl.mock_calls == [ assert mock_pfctl.mock_calls == [
call('-s Interfaces -i lo -v'), call('-s Interfaces -i lo -v'),