From cab73cde07316095d95b8a2edb413a33cf5597c5 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sun, 3 May 2020 10:35:56 +0800 Subject: [PATCH] also check ptp nodes --- route/PTP,10.127.4.253~10.127.69.1 | 2 +- route/PTP,10.127.4.254~10.127.11.199 | 2 +- scripts/roa.py | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/route/PTP,10.127.4.253~10.127.69.1 b/route/PTP,10.127.4.253~10.127.69.1 index f8b2075..8b5e46a 100644 --- a/route/PTP,10.127.4.253~10.127.69.1 +++ b/route/PTP,10.127.4.253~10.127.69.1 @@ -1,4 +1,4 @@ TYPE="PTP" PROTO="WireGuard" -UPSTREAM="MagicNeko-JP3" +UPSTREAM="MagicNeko-JP03" DOWNSTREAM="santost12" diff --git a/route/PTP,10.127.4.254~10.127.11.199 b/route/PTP,10.127.4.254~10.127.11.199 index 202cc3a..42b6ac7 100644 --- a/route/PTP,10.127.4.254~10.127.11.199 +++ b/route/PTP,10.127.4.254~10.127.11.199 @@ -1,4 +1,4 @@ TYPE="PTP" PROTO="WireGuard" -UPSTREAM="Icecat-Explosion" +UPSTREAM="MagicNeko-HK01" DOWNSTREAM="SUNNET" diff --git a/scripts/roa.py b/scripts/roa.py index ba067db..dc351f1 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -143,8 +143,11 @@ def neonet_route2roa(dirname, is_ipv6=False): supernet = get_supernet(fc.get('supernet')) netname = "%s-%s" % (fc.get('type'), route) roa_entries.append(dict(zip(roa_entries_key, [asn, nettype(route, strict=True), supernet, netname]))) + elif fc.get('type').lower() == 'ptp': + assert NODE_TABLE[fc.get('upstream')] # extra check for upstream + assert NODE_TABLE[fc.get('downstream')] # extra check for downstream else: - assert fc.get('type').lower() in ('ptp',) + raise AssertionError except Exception: print("[!] Error while processing file", f) raise