* [PATCH] location-importer: Replace "UK" with "GB"
@ 2021-12-12 9:11 Peter Müller
0 siblings, 0 replies; only message in thread
From: Peter Müller @ 2021-12-12 9:11 UTC (permalink / raw)
To: location
[-- Attachment #1: Type: text/plain, Size: 748 bytes --]
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 <peter.mueller(a)ipfire.org>
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-12 9:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-12 9:11 [PATCH] location-importer: Replace "UK" with "GB" Peter Müller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox