diff options
author | vieira <vieira@yubo.be> | 2017-11-07 01:20:24 +0000 |
---|---|---|
committer | Brian May <brian@linuxpenguins.xyz> | 2017-11-08 16:17:06 +1100 |
commit | 47030e846b0d37de41c6c86de531fda5b8b4152a (patch) | |
tree | dde9f480d667b14ce4fc637958096c8439796878 | |
parent | 416636fa9b41e55d63a358fc997ad80174222a46 (diff) |
Remove trailing whitespaces
-rw-r--r-- | sshuttle/methods/ipfw.py | 14 | ||||
-rw-r--r-- | sshuttle/sdnotify.py | 2 | ||||
-rw-r--r-- | sshuttle/tests/client/test_firewall.py | 2 | ||||
-rw-r--r-- | sshuttle/tests/client/test_methods_pf.py | 2 | ||||
-rw-r--r-- | sshuttle/tests/client/test_methods_tproxy.py | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/sshuttle/methods/ipfw.py b/sshuttle/methods/ipfw.py index e696b1f..34740b3 100644 --- a/sshuttle/methods/ipfw.py +++ b/sshuttle/methods/ipfw.py @@ -150,17 +150,17 @@ def ipfw_noexit(*args): ssubprocess.call(argv) class Method(BaseMethod): - + def get_supported_features(self): result = super(Method, self).get_supported_features() result.ipv6 = False result.udp = False #NOTE: Almost there, kernel patch needed result.dns = True return result - + def get_tcp_dstip(self, sock): return sock.getsockname() - + def recv_udp(self, udp_listener, bufsize): srcip, dstip, data = recv_udp(udp_listener, bufsize) if not dstip: @@ -199,7 +199,7 @@ class Method(BaseMethod): raise Exception( 'Address family "%s" unsupported by ipfw method_name' % family_to_string(family)) - + #XXX: Any risk from this? ipfw_noexit('delete', '1') @@ -207,13 +207,13 @@ class Method(BaseMethod): name = _changedctls.pop() oldval = _oldctls[name] _sysctl_set(name, oldval) - + if subnets or dnsport: sysctl_set('net.inet.ip.fw.enable', 1) - + ipfw('add', '1', 'check-state', 'ip', 'from', 'any', 'to', 'any') - + ipfw('add', '1', 'skipto', '2', 'tcp', 'from', 'any', 'to', 'table(125)') diff --git a/sshuttle/sdnotify.py b/sshuttle/sdnotify.py index ac478f4..644c600 100644 --- a/sshuttle/sdnotify.py +++ b/sshuttle/sdnotify.py @@ -9,7 +9,7 @@ def _notify(message): return False addr = '\0' + addr[1:] if addr[0] == '@' else addr - + try: sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) except (OSError, IOError) as e: diff --git a/sshuttle/tests/client/test_firewall.py b/sshuttle/tests/client/test_firewall.py index bc7a8ac..8b888fb 100644 --- a/sshuttle/tests/client/test_firewall.py +++ b/sshuttle/tests/client/test_firewall.py @@ -84,7 +84,7 @@ def test_subnet_weight(): (socket.AF_INET, 16, 0, '192.168.0.0', 0, 0), (socket.AF_INET, 0, 1, '0.0.0.0', 0, 0) ] - + assert subnets_sorted == \ sorted(subnets, key=sshuttle.firewall.subnet_weight, reverse=True) diff --git a/sshuttle/tests/client/test_methods_pf.py b/sshuttle/tests/client/test_methods_pf.py index 2a26575..985456d 100644 --- a/sshuttle/tests/client/test_methods_pf.py +++ b/sshuttle/tests/client/test_methods_pf.py @@ -424,7 +424,7 @@ def test_setup_firewall_openbsd(mock_pf_get_dev, mock_ioctl, mock_pfctl): mock_pf_get_dev.reset_mock() mock_ioctl.reset_mock() mock_pfctl.reset_mock() - + with pytest.raises(Exception) as excinfo: method.setup_firewall( 1025, 1027, diff --git a/sshuttle/tests/client/test_methods_tproxy.py b/sshuttle/tests/client/test_methods_tproxy.py index 89b47d1..47eb017 100644 --- a/sshuttle/tests/client/test_methods_tproxy.py +++ b/sshuttle/tests/client/test_methods_tproxy.py @@ -241,7 +241,7 @@ def test_setup_firewall(mock_ipt_chain_exists, mock_ipt_ttl, mock_ipt): '--tproxy-mark', '0x1/0x1', '--dest', u'1.2.3.33/32', '-m', 'udp', '-p', 'udp', '--dport', '53', '--on-port', '1027'), call(2, 'mangle', '-A', 'sshuttle-m-1025', '-j', 'RETURN', - '--dest', u'1.2.3.66/32', '-m', 'tcp', '-p', 'tcp', + '--dest', u'1.2.3.66/32', '-m', 'tcp', '-p', 'tcp', '--dport', '80:80'), call(2, 'mangle', '-A', 'sshuttle-t-1025', '-j', 'RETURN', '--dest', u'1.2.3.66/32', '-m', 'tcp', '-p', 'tcp', |