1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

don't do external RPKI lookups for non-global prefixes

This commit is contained in:
checktheroads
2021-02-25 23:40:19 -07:00
parent e4f4eb85b0
commit f69322013d

View File

@@ -3,6 +3,7 @@
# Standard Library
import re
from typing import List
from ipaddress import ip_network
# Third Party
from pydantic import StrictInt, StrictStr, StrictBool, constr, validator
@@ -87,6 +88,13 @@ class ParsedRouteEntry(HyperglassModel):
# Get last ASN in path
asn = as_path[-1]
try:
net = ip_network(values["prefix"])
except ValueError:
return 3
# Only do external RPKI lookups for global prefixes.
if net.is_global:
return rpki_state(prefix=values["prefix"], asn=asn)
else:
return value