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:
parent
0476e0b936
commit
b34b031ce6
2 changed files with 3 additions and 2 deletions
|
@ -29,7 +29,7 @@ def main():
|
||||||
if isinstance(address, IPv4Address):
|
if isinstance(address, IPv4Address):
|
||||||
pointer = address.reverse_pointer.replace(".127.10.in-addr.arpa", "")
|
pointer = address.reverse_pointer.replace(".127.10.in-addr.arpa", "")
|
||||||
records.append("%s\tIN\tPTR\t%s.neo." % (pointer, name))
|
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__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -122,7 +122,8 @@ def route_to_roa(asn_table: dict):
|
||||||
):
|
):
|
||||||
if not net1["prefix"].overlaps(net2["prefix"]):
|
if not net1["prefix"].overlaps(net2["prefix"]):
|
||||||
continue
|
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"])
|
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
|
||||||
|
|
Loading…
Reference in a new issue