]> git.ipfire.org Git - location/libloc.git/commitdiff
location-importer: Skip everything with /0
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 15 May 2020 12:29:07 +0000 (12:29 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 15 May 2020 12:29:07 +0000 (12:29 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/location-importer.in

index 2d2a7ec554e778e074e14f39bae1cc02b68f8f31..36a525ee5bffbdba05196437844e8abe4eb8f97c 100644 (file)
@@ -590,6 +590,11 @@ class CLI(object):
                                                                log.warning("Invalid IP network: %s: %s" % (network, e))
                                                                continue
 
+                                                       # Prevent that we overwrite all networks
+                                                       if network.prefixlen == 0:
+                                                               log.warning("Skipping %s: You cannot overwrite default" % network)
+                                                               continue
+
                                                        self.db.execute("""
                                                                INSERT INTO network_overrides(
                                                                        network,