]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: Fix determination of IPv6 link-local addresses
authorMartin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
Fri, 19 Feb 2021 11:09:16 +0000 (12:09 +0100)
committerMartin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
Mon, 22 Feb 2021 08:48:16 +0000 (09:48 +0100)
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>
tests/topotests/lib/topotest.py

index 1e6ef1b2b3ba4c2f451e4a2c99ae154a86cae8e6..7523bc70c6c4196d0ee5a96d60484cfc10946348 100644 (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