1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-11-05 18:22:26 +08:00

roa.py: fix

This commit is contained in:
JerryXiao 2020-08-29 23:32:03 +08:00
parent b34b031ce6
commit 9793b64b1a
Signed by: Jerry
GPG key ID: 9D9CE43650FF2BAA

View file

@ -123,7 +123,11 @@ def route_to_roa(asn_table: dict):
if not net1["prefix"].overlaps(net2["prefix"]): if not net1["prefix"].overlaps(net2["prefix"]):
continue continue
entity_from_net = lambda net: asn_table.get(net["asn"])["owner"] entity_from_net = lambda net: asn_table.get(net["asn"])["owner"]
assert net1["prefix"] != net2["prefix"] or (net1['asn'] != net2['asn'] and entity_from_net(net1) == entity_from_net(net2)) try:
assert net1["prefix"] != net2["prefix"]
except AssertionError:
assert net1['asn'] != net2['asn'] and entity_from_net(net1) == entity_from_net(net2)
continue
assert net1["prefix"].supernet_of(net2["prefix"]) assert net1["prefix"].supernet_of(net2["prefix"])
s1net, s2net = (net1["supernet"], net2["supernet"]) s1net, s2net = (net1["supernet"], net2["supernet"])
assert s2net # please include supernet = <cidr> in your route assert s2net # please include supernet = <cidr> in your route