From f15a85a0d8147e63cc94eed695561b1df64a197a Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 2 Jun 2019 21:37:07 +0200 Subject: [PATCH] Check for maximum prefix length violation, too --- generate.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generate.py b/generate.py index 653403b..eb9a4dd 100755 --- a/generate.py +++ b/generate.py @@ -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