From patchwork Thu Apr 1 19:57:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 4088 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FBDVV4TF2z3x1r for ; Thu, 1 Apr 2021 19:57:22 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FBDVV27KhzBs; Thu, 1 Apr 2021 19:57:22 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FBDVV1VSYz2xd2; Thu, 1 Apr 2021 19:57:22 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FBDVT13kCz2xd2 for ; Thu, 1 Apr 2021 19:57:21 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4FBDVR5FYgzBs for ; Thu, 1 Apr 2021 19:57:19 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1617307040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pkOjcfrtuyWVWDPwx24ZrzqubPR05+mWxJEPVD0MGVA=; b=vTqQW4KW04vck6LwcwIaR3t1WptQjj744ifDkKtJCbtPtsB5oY4EYK/ugVezL+vAowsQa9 bQXSMMNrBwdvvECQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1617307040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pkOjcfrtuyWVWDPwx24ZrzqubPR05+mWxJEPVD0MGVA=; b=en4fNtcmNg1YZRJD+HrwIJNNUWnO/5c6j5jmrrZNoE8yp58WVIocUaSfeX+CeRqWRxkoOb 2eUjxl8FSsMVrpmyfLr7wPEY5GXBqi//CFHPfSURhsrlSEQXIXIF3gwhUT794KQLNmyfM6 zrlSrFHOj8JiIi3lpqewbWntprD/5yacmAJopNWjbuLo6xm0z65RP6Em39SbHyWPO/u3Wv r7ELe5NXdjDIEMwKm6ZpGzBRhA4RKRV5QJhrVcg2vOPEVuW3UDu2rO6y49YqQ3LsCgSSAB 7wMzplCnEgtS7oZGny2ITAqL5LUd/rzO3jR7kkWs/nwD8immerw2eW2nXVwydw== To: "IPFire: Location" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH] location-importer.in: treat AQ and BV as invalid countries Message-ID: Date: Thu, 1 Apr 2021 21:57:15 +0200 MIME-Version: 1.0 Content-Language: en-US X-BeenThere: location@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: location-bounces@lists.ipfire.org Sender: "Location" Both the Bouvet Island (BV) and Antarctica (AQ) are unpopulated at the time of writing. Network owners/operators putting these countries into their RIR data objects are either completely braindead or doing so for hostile reasons. While we might correct these locations to something useful by manually creating overrides for them, the rationale behind this patch is not to let these countries appear on productive systems in the first place, as we know they _cannot_ be true. Therefore, this patch skips any network object that has either AQ or BV country code set. See also: https://lists.ipfire.org/pipermail/location/2020-October/000199.html Signed-off-by: Peter Müller --- src/python/location-importer.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/location-importer.in b/src/python/location-importer.in index 1e08458..ac678dc 100644 --- a/src/python/location-importer.in +++ b/src/python/location-importer.in @@ -624,7 +624,7 @@ class CLI(object): return # Skip objects with unknown country codes - if validcountries and inetnum.get("country") not in validcountries: + if validcountries and (inetnum.get("country") not in validcountries or inetnum.get("country") in ["AQ", "BV"]): log.warning("Skipping network with bogus country '%s': %s" % \ (inetnum.get("country"), inetnum.get("inet6num") or inetnum.get("inetnum"))) return