diff options
author | vieira <vieira@yubo.be> | 2016-07-27 23:18:25 +0000 |
---|---|---|
committer | vieira <vieira@yubo.be> | 2016-07-27 23:18:25 +0000 |
commit | 8520ea278798ab10f24fa477fcb94a218ab5d73a (patch) | |
tree | 098c97ee4ac9a947d755307f450c92aae6a007ad | |
parent | 6a394deaf27a271cff2b402aa0ace691c8cafc83 (diff) |
Use == instead of is to compare with AF_INET
-rw-r--r-- | sshuttle/methods/pf.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sshuttle/methods/pf.py b/sshuttle/methods/pf.py index 5d20ba6..75d85e7 100644 --- a/sshuttle/methods/pf.py +++ b/sshuttle/methods/pf.py @@ -122,10 +122,10 @@ class Generic(object): ioctl(pf_get_dev(), pf.DIOCCHANGERULE, pr) def _inet_version(self, family): - return b'inet' if family is socket.AF_INET else b'inet6' + return b'inet' if family == socket.AF_INET else b'inet6' def _lo_addr(self, family): - return b'127.0.0.1' if family is socket.AF_INET else b'::1' + return b'127.0.0.1' if family == socket.AF_INET else b'::1' def add_rules(self, anchor, rules): assert isinstance(rules, bytes) @@ -369,7 +369,7 @@ def pf_get_dev(): def pf_get_anchor(family, port): - return 'sshuttle%s-%d' % ('' if family is socket.AF_INET else '6', port) + return 'sshuttle%s-%d' % ('' if family == socket.AF_INET else '6', port) class Method(BaseMethod): |