Prevent 4-byte AS capability from being treated like it is ASN

Bird displays neighbor's 4-byte AS capability as `AS4`.
This patch prevents it from being treated as an clickable ASN in the output of `show protocols <protocol_name> all` response.
This commit is contained in:
tamihiro 2019-06-09 21:31:38 +09:00
parent 85963901f8
commit 822d54cd3d
1 changed files with 1 additions and 1 deletions

2
lg.py
View File

@ -76,7 +76,7 @@ def add_links(text):
ret_text.append(re.sub(r'(\d+)', r'<a href="/whois?q=\1" class="whois">\1</a>', line))
else:
line = re.sub(r'([a-zA-Z0-9\-]*\.([a-zA-Z]{2,3}){1,2})(\s|$)', r'<a href="/whois?q=\1" class="whois">\1</a>\3', line)
line = re.sub(r'AS(\d+)', r'<a href="/whois?q=\1" class="whois">AS\1</a>', line)
line = re.sub(r'(?<=\[)AS(\d+)', r'<a href="/whois?q=\1" class="whois">AS\1</a>', line)
line = re.sub(r'(\d+\.\d+\.\d+\.\d+)', r'<a href="/whois?q=\1" class="whois">\1</a>', line)
if len(request.path) >= 2:
hosts = "/".join(request.path.split("/")[2:])