From ef83a5c5736341573c21b39e347f39f5387b6faa Mon Sep 17 00:00:00 2001 From: vieira Date: Tue, 4 Apr 2017 22:30:38 +0000 Subject: [PATCH] Work around non tabular headers in BSD netstat netstat outputs some headers in BSD (that the Linux version does not) that are not tabular and were breaking our 'split line into columns and get nth column' logic. We now skip such headers. Should fix #141. --- sshuttle/server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sshuttle/server.py b/sshuttle/server.py index 4f7b67c..c7c13ea 100644 --- a/sshuttle/server.py +++ b/sshuttle/server.py @@ -67,6 +67,8 @@ def _shl(n, bits): def _route_netstat(line): cols = line.split(None) + if len(cols) < 3: + return None, None ipw = _ipmatch(cols[0]) maskw = _ipmatch(cols[2]) # linux only mask = _maskbits(maskw) # returns 32 if maskw is null