From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter =?utf-8?q?M=C3=BCller?= To: location@lists.ipfire.org Subject: Re: [PATCH] location-importer.in: treat AQ and BV as invalid countries Date: Mon, 12 Apr 2021 19:26:42 +0200 Message-ID: In-Reply-To: <398AB96C-EF76-4DD8-BC5B-77066B2F7ABB@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4375245836468542644==" List-Id: --===============4375245836468542644== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello Michael, thanks for your reply. I believe you are mixing up two distinct scenarios here: (a) Historic ISO-3166-X abbreviations for countries no longer existing anymor= e, such as YU. (b) Country codes for existing nations, where we believe with a high level of= confidence no IP networks are located in any way, either physically or legally. AQ and = BV are the most notable examples known to me at the time of writing. Since it does not make sense to add historic country codes, I would suggest t= o leave networks assigned to (a) countries as they are, manually creating overrides for them, = as I did before. For (b), simply scrubbing out the country or region they belong to seems to b= e too harsh to me, as we use this information for several things, and should not abuse it fo= r our own purposes. Therefore, I rather suggest adding an additional column to countries.txt for = indicating whether this country code is acceptable to us or not. Thanks, and best regards, Peter M=C3=BCller > Hello, >=20 > How about we add the country to the list and mark the continent with a =E2= =80=9C-=E2=80=9C: >=20 > AF AS Afghanistan > YU - Yugoslavia >=20 > -Michael >=20 >> On 10 Apr 2021, at 13:32, Peter M=C3=BCller w= rote: >> >> Hello Michael, >> >> thanks for your reply. >> >> Yes, having this configurable in countries.txt would be nice indeed. Do yo= u propose a certain syntax for this? >> >> And yes, a tuple is a better idea here. I will wait for your reply and sub= mit a second version of this patch then. >> >> Thanks, and best regards, >> Peter M=C3=BCller >> >> >>> Hello, >>> >>> * would we not want this to be configurable in countries.txt? >>> >>> * The list should probably be a tuple. >>> >>> -Michael >>> >>>> On 1 Apr 2021, at 20:57, Peter M=C3=BCller = wrote: >>>> >>>> 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/00019= 9.html >>>> >>>> Signed-off-by: Peter M=C3=BCller >>>> --- >>>> 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-impor= ter.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 o= r inetnum.get("country") in ["AQ", "BV"]): >>>> log.warning("Skipping network with bogus country '%s': %s" % \ >>>> (inetnum.get("country"), inetnum.get("inet6num") or inetnum.get("ine= tnum"))) >>>> return >>>> --=20 >>>> 2.26.2 >>> >=20 --===============4375245836468542644==--