]> git.ipfire.org Git - location/libloc.git/commitdiff
importer: Also import networks that are smaller than /48 or /24
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2024 10:23:49 +0000 (10:23 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2024 10:25:31 +0000 (10:25 +0000)
These cannot appear in the global routing table, but that does not mean
that there isn't any value in importing them into our database.

In case they are just noise, we will filter them out later on.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/location-importer.in

index 4b340374226a0d70b971ccc354a4a55311dc7717..080b776c909e7045914c525d2c9440939aa7422c 100644 (file)
@@ -904,9 +904,6 @@ class CLI(object):
                        (b) covering a too large chunk of the IP address space (prefix length
                                is < 7 for IPv4 networks, and < 10 for IPv6)
                        (c) "0.0.0.0" or "::" as a network address
-                       (d) are too small for being publicly announced (we have decided not to
-                               process them at the moment, as they significantly enlarge our
-                               database without providing very helpful additional information)
 
                        This unfortunately is necessary due to brain-dead clutter across
                        various RIR databases, causing mismatches and eventually disruptions.
@@ -932,22 +929,16 @@ class CLI(object):
                        log.debug("Skipping unspecified network: %s" % network)
                        return False
 
-               if network.version == 4:
-                       if network.prefixlen < 7:
-                               log.debug("Skipping too big IP chunk: %s" % network)
-                               return False
-
-                       if network.prefixlen > 24:
-                               log.debug("Skipping network too small to be publicly announced: %s" % network)
-                               return False
-
-               elif network.version == 6:
+               # IPv6
+               if network.version == 6:
                        if network.prefixlen < 10:
                                log.debug("Skipping too big IP chunk: %s" % network)
                                return False
 
-                       if network.prefixlen > 48:
-                               log.debug("Skipping network too small to be publicly announced: %s" % network)
+               # IPv4
+               elif network.version == 4:
+                       if network.prefixlen < 7:
+                               log.debug("Skipping too big IP chunk: %s" % network)
                                return False
 
                # In case we have made it here, the network is considered to