Skip to content

Commit

Permalink
Fix ip address parsing
Browse files Browse the repository at this point in the history
It has to match line like
  inet6 fd7c:d314:b55d:94cb:831:d243:60d2:7c11 prefixlen 64 autoconf secured
  • Loading branch information
brona committed Jul 31, 2024
1 parent 073422a commit db39d0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def parse_ifconfig(res, af, address):
link["addr_info"] = link.get("addr_info", []) + [addr]
elif address and re.match(r"^\s+inet6 ", r) and af != 4:
(local, prefixlen) = re.findall(
r"inet6 ([0-9a-f:]*::[0-9a-f:]+)%*\w* prefixlen (\d+)", r)[0]
r"inet6 ([0-9a-f:]*:[0-9a-f:]+)%*\w* prefixlen (\d+)", r)[0]
link["addr_info"] = link.get("addr_info", []) + [{
"family": "inet6",
"local": local,
Expand Down

0 comments on commit db39d0f

Please sign in to comment.