tests: Fix determination of IPv6 link-local addresses

When parsing the output of "ip -6 address", allow arbitrary base interface
names (the part after "@" in the interface name), not just "if0-9". Without
this, link-local addresses sometimes are attributed to the wrong interface
because we're not matching the interface name but still handle the
interface's addresses.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
This commit is contained in:
Martin Buck 2021-02-19 12:09:16 +01:00
parent 2031dbf31c
commit fd03dacd03

View File

@ -1723,7 +1723,7 @@ class Router(Node):
interface = ""
ll_per_if_count = 0
for line in ifaces:
m = re.search("[0-9]+: ([^:@]+)[@if0-9:]+ <", line)
m = re.search("[0-9]+: ([^:@]+)[-@a-z0-9:]+ <", line)
if m:
interface = m.group(1)
ll_per_if_count = 0