1
0
Fork 0
mirror of https://github.com/sileht/bird-lg.git synced 2024-11-21 22:44:43 +01:00

bgpmap: fix regexp to match interface names with non-alphanumerical characters

Commit eaf531eee2 ("Correctly parse aspath for both bird 1.x and 2.0.")
inadvertently made a regexp more strict, and it no longer matches some
interface names.  Example include `eth1.945` (tagged VLAN, which is a
common use-case for routers) or `br-foo`.

As a result, the regexp would not parse the "peer protocol name" that is
normally displayed on the bgpmap.

Fixes: #64
This commit is contained in:
Baptiste Jonglez 2020-06-16 15:39:55 +02:00
parent 53e717381d
commit 967c721b86

2
lg.py
View file

@ -568,7 +568,7 @@ def build_as_tree_from_raw_bird_ouput(host, proto, text):
net_dest = expr.group(1).strip() net_dest = expr.group(1).strip()
peer_protocol_name = expr.group(2).strip() peer_protocol_name = expr.group(2).strip()
expr2 = re.search(r'(.*)via\s+([0-9a-fA-F:\.]+)\s+on\s+\w+(\s+\[(\w+)\s+)?', line) expr2 = re.search(r'(.*)via\s+([0-9a-fA-F:\.]+)\s+on\s+\S+(\s+\[(\w+)\s+)?', line)
if expr2: if expr2:
if path: if path:
path.append(net_dest) path.append(net_dest)