Skip to content

Commit

Permalink
bgpmap: fix regexp to match interface names with non-alphanumerical c…
Browse files Browse the repository at this point in the history
…haracters

Commit eaf531e ("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
  • Loading branch information
Baptiste Jonglez committed Jun 16, 2020
1 parent 53e7173 commit 967c721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lg.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def build_as_tree_from_raw_bird_ouput(host, proto, text):
net_dest = expr.group(1).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 path:
path.append(net_dest)
Expand Down

0 comments on commit 967c721

Please sign in to comment.