]> git.ipfire.org Git - location/libloc.git/commit
location-importer.in: skip networks with unknown country codes
authorPeter Müller <peter.mueller@ipfire.org>
Tue, 30 Mar 2021 15:47:10 +0000 (17:47 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 31 Mar 2021 14:03:02 +0000 (14:03 +0000)
commit84b175e2fffbe28be8343e99705d8438c0daa3a0
tree3538b73164eb1111cb1828e7bd013123a9c45c68
parent1814283b82e479f60c0871f0518593f1c6fd4b87
location-importer.in: skip networks with unknown country codes

There is no sense in parsing and storting networks whose country codes
cannot be found in the ISO-3166-x country code table. This avoids side
effects in applications using the location database, and introduces
another sanity check to compensate bogus RIR data.

On location02, this affects some networks from APNIC (country code: ZZ)
as well as a bunch of smaller allocations within the RIPE region still
tagged to CS or YU (Yugoslavia). To my surprise, no network tagged as SU
(Soviet Union) was found - while the NIC for .su TLD is still
operational. :-)

Applying this patch causes the countries to be processed before
update_whois() is called. In case no countries are present in the SQL
table, this check is silently omitted.

Fixes: #12510
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/location-importer.in