From ba59fd48d1a56b320f483750f1b79c61c5e6b265 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Sat, 13 Jun 2020 19:52:22 +0200 Subject: [PATCH] Stub detection + no path protection for crawl converter --- backend/crawler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/crawler.py b/backend/crawler.py index 5814616..992c457 100644 --- a/backend/crawler.py +++ b/backend/crawler.py @@ -196,7 +196,11 @@ def convert_crawl(crawl): prefix = "{}/{}".format(ann.ip, ann.prefix) path = list(map(int, ann.ASPath.split())) net.nodes[asn.number]['routing_table'].add((prefix, tuple(path))) - net.nodes[path[-1]]['prefixes'].add(prefix) + if path: + net.nodes[path[-1]]['prefixes'].add(prefix) + for path_asn in path: + if path_asn not in (path[-1], path[0]): + net.nodes[path_asn]['stub'] = False # add neighbor count for node, data in net.nodes(data=True):