1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-11-22 14:40:41 +08:00

roa.py: allow same net different asns, as long as those asns are owned by the same entity

dns-reverse-generator.py: add newline
This commit is contained in:
JerryXiao 2020-08-29 23:22:55 +08:00
parent 0476e0b936
commit b34b031ce6
Signed by: Jerry
GPG key ID: 9D9CE43650FF2BAA
2 changed files with 3 additions and 2 deletions

View file

@ -29,7 +29,7 @@ def main():
if isinstance(address, IPv4Address):
pointer = address.reverse_pointer.replace(".127.10.in-addr.arpa", "")
records.append("%s\tIN\tPTR\t%s.neo." % (pointer, name))
RESOLVE_FILE.write_text("\n".join(records))
RESOLVE_FILE.write_text("\n".join(records)+"\n")
if __name__ == "__main__":

View file

@ -122,7 +122,8 @@ def route_to_roa(asn_table: dict):
):
if not net1["prefix"].overlaps(net2["prefix"]):
continue
assert net1["prefix"] != net2["prefix"]
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))
assert net1["prefix"].supernet_of(net2["prefix"])
s1net, s2net = (net1["supernet"], net2["supernet"])
assert s2net # please include supernet = <cidr> in your route