From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter =?utf-8?q?M=C3=BCller?= To: location@lists.ipfire.org Subject: [PATCH] location-importer: Replace "UK" with "GB" Date: Sun, 12 Dec 2021 10:11:43 +0100 Message-ID: <7822de27-5ce9-dfbc-7408-9c5f0ecd7b2e@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4201847819717954206==" List-Id: --===============4201847819717954206== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Apparently, LACNIC does not to proper input validation on supplied country codes, so people can use "UK", while they probably mean "GB" instead. Signed-off-by: Peter Müller --- src/python/location-importer.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/python/location-importer.in b/src/python/location-importer.in index b791b4d..099af55 100644 --- a/src/python/location-importer.in +++ b/src/python/location-importer.in @@ -705,6 +705,10 @@ class CLI(object): # ... but keep this list distinct... continue + # When people set country codes to "UK", they actually mean "GB" + if val == "UK": + val = "GB" + inetnum[key].append(val) # Skip empty objects -- 2.26.2 --===============4201847819717954206==--