Permalink
Browse files

[max-length] Fix ROA parsing issue

The ROA update and generate methods were parsing the ipv4 and ipv6
instance variables as if they were resource sets, rather than ROA
prefix sets.  This works as expected when max-length is not being
used, but when max-length is used, parsing does not succeed and ROAs
cannot be generated or updated.  Parsing each variable as if it's a
ROA prefix set, and then converting the result to a resource set,
appears to fix the problem.

Signed-off-by: Rob Austein <sra@hactrn.net>
  • Loading branch information...
tomhrr authored and sraustein committed Aug 25, 2018
1 parent 1acf23f commit 349194f64968fdade05c70db900e8518d56114ad
Showing with 4 additions and 4 deletions.
  1. +4 −4 rpki/rpkidb/models.py
View
@@ -2318,8 +2318,8 @@ def update(self, publisher):
logger.debug("%r oversized with respect to CA, regenerating", self)
return self.regenerate(publisher = publisher)
v4 = rpki.resource_set.resource_set_ipv4(self.ipv4)
v6 = rpki.resource_set.resource_set_ipv6(self.ipv6)
v4 = rpki.resource_set.roa_prefix_set_ipv4(self.ipv4).to_resource_set()
v6 = rpki.resource_set.roa_prefix_set_ipv6(self.ipv6).to_resource_set()
if ee_resources.v4 != v4 or ee_resources.v6 != v6:
logger.debug("%r resources do not match EE, regenerating", self)
@@ -2353,8 +2353,8 @@ def generate(self, publisher):
if self.ipv4 is None and self.ipv6 is None:
raise rpki.exceptions.EmptyROAPrefixList
v4 = rpki.resource_set.resource_set_ipv4(self.ipv4)
v6 = rpki.resource_set.resource_set_ipv6(self.ipv6)
v4 = rpki.resource_set.roa_prefix_set_ipv4(self.ipv4).to_resource_set()
v6 = rpki.resource_set.roa_prefix_set_ipv6(self.ipv6).to_resource_set()
# http://stackoverflow.com/questions/26270042/how-do-you-catch-this-exception
# "Django is amazing when its not terrifying."

0 comments on commit 349194f

Please sign in to comment.