aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Elkins <melkins@tislabs.com>2012-02-07 01:03:16 +0000
committerMichael Elkins <melkins@tislabs.com>2012-02-07 01:03:16 +0000
commit8d1ffb425477957565fcfd916314a74c2506a443 (patch)
tree60e93ef888de999b24a9add5f4e04e2a13103790
parente4c5873f3c320da087d5ccd7bfa64534f97c87fc (diff)
need to check max prefix length when checking new roa
svn path=/branches/tk161/; revision=4297
-rw-r--r--rpkid/rpki/gui/app/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/rpkid/rpki/gui/app/views.py b/rpkid/rpki/gui/app/views.py
index abfddc72..795080fc 100644
--- a/rpkid/rpki/gui/app/views.py
+++ b/rpkid/rpki/gui/app/views.py
@@ -472,7 +472,7 @@ def roa_create(request):
# if the route was previously unknown (no covering
# ROAs), then:
# if the AS matches, it is valid, otherwise invalid
- if route.asn == asn:
+ if (route.asn != 0 and route.asn == asn and route.prefixlen() <= max_prefixlen):
route.status = 'valid'
route.status_label = 'success'
else:
@@ -481,7 +481,7 @@ def roa_create(request):
elif route.status == 'invalid':
# if the route was previously invalid, but this new ROA
# matches the ASN, it is now valid
- if route.asn == asn:
+ if route.asn != 0 and route.asn == asn and route.prefixlen() <= max_prefixlen:
route.status = 'valid'
route.status_label = 'success'