Use rsplit

Fixes exception thrown on ipv6 addresses

ValueError: invalid literal for int() with base 10: ':ffff:1.2.3.4:5678'
This commit is contained in:
Sean Brennan 2019-05-01 14:34:09 -04:00 committed by Ch3LL
parent 60029398c6
commit 69fe65b550
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73

View file

@ -1486,8 +1486,8 @@ def _netlink_tool_remote_on(port, which_end):
elif 'ESTAB' not in line:
continue
chunks = line.split()
local_host, local_port = chunks[3].split(':', 1)
remote_host, remote_port = chunks[4].split(':', 1)
local_host, local_port = chunks[3].rsplit(':', 1)
remote_host, remote_port = chunks[4].rsplit(':', 1)
if which_end == 'remote_port' and int(remote_port) != port:
continue