From a21197f83b60299008adfee36e27da0c520d0f76 Mon Sep 17 00:00:00 2001 From: Andrew Pimenov Date: Mon, 10 Aug 2026 21:18:42 +0300 Subject: [PATCH] actually stage the bgp_path.py half of the international-loop fix --- src/netsleuth/probes/bgp_path.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/netsleuth/probes/bgp_path.py b/src/netsleuth/probes/bgp_path.py index d9c6ad4..3a50e42 100644 --- a/src/netsleuth/probes/bgp_path.py +++ b/src/netsleuth/probes/bgp_path.py @@ -62,12 +62,8 @@ def colo_location(code: str | None) -> tuple[str | None, str | None]: return COLO_LOCATIONS.get(code.upper(), (None, None)) -def detect_international_loop( - client_country: str | None, ip_country: str | None, edge_country: str | None -) -> tuple[bool, list[str]]: - if not client_country or not ip_country or client_country != ip_country: - return False, [] - if not edge_country or edge_country == client_country: +def detect_international_loop(client_country: str | None, edge_country: str | None) -> tuple[bool, list[str]]: + if not client_country or not edge_country or edge_country == client_country: return False, [] return True, [edge_country] @@ -79,7 +75,7 @@ def build_path_diversity(client_country: str | None, hops: list[AnycastHop]) -> international_loop = False detour_countries: list[str] = [] for hop in hops: - is_loop, countries = detect_international_loop(client_country, hop.ip_country, hop.edge_country) + is_loop, countries = detect_international_loop(client_country, hop.edge_country) if is_loop: international_loop = True for country in countries: