diff --git a/generate.py b/generate.py index 20eac54..653403b 100755 --- a/generate.py +++ b/generate.py @@ -113,12 +113,13 @@ def create_roa_entries(route_objects, filter_rules, mode, f): # Now check if it permits or denies if matching_filter_rule['route_allowed'] == False: # Skip non-permitted routes - f.write('# route object not permitted: ' + str(route_network) + "\n") - f.write('# route object was denied by filter rule: ' + str(matching_filter_rule) + "\n") + f.write('# DENIED' + str(route_object) + ' by filter rule: ' + str(matching_filter_rule) + '\n') continue # Check if min-length fits filter requirements - - + if matching_filter_rule['min_length'] > route_network.prefixlen: + # Drop route objects which do not satisfy min_length requirement of matching filter rule + f.write('# FAILED minimum prefix length requirement exceeded: ' + str(route_object) + ' against filter rule: ' + str(matching_filter_rule) + '\n') + continue # Figure out max-length (filter rule wins over route object) if 'max-length' in route_object.keys(): allowed_max_len = min(int(matching_filter_rule['max_length']), int(route_object['max-length']))