0
0
Fork 0

Check for maximum prefix length violation, too

This commit is contained in:
Jan Philipp Timme 2019-06-02 21:37:07 +02:00
parent 3b64d0d363
commit f15a85a0d8
1 changed files with 4 additions and 0 deletions

View File

@ -125,6 +125,10 @@ def create_roa_entries(route_objects, filter_rules, mode, f):
allowed_max_len = min(int(matching_filter_rule['max_length']), int(route_object['max-length']))
else:
allowed_max_len = int(matching_filter_rule['max_length'])
if allowed_max_len < route_network.prefixlen:
# Drop route objects which do not satisfy max_length requirement of matching filter rule
f.write('# FAILED maximum prefix length exceeded: ' + str(route_object) + ' against filter rule: ' + str(matching_filter_rule) + '\n')
continue
# Create roa for every origin of this route
for origin in route_object['origin']:
# Make sure to strip "AS" prefix from AS value