mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-28 10:53:21 +01:00
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.
This commit is contained in:
parent
af9ebd0f4b
commit
ef83a5c573
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user