From: Michael Tremer Date: Mon, 4 Mar 2024 10:23:49 +0000 (+0000) Subject: importer: Also import networks that are smaller than /48 or /24 X-Git-Tag: 0.9.18~112 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c940dcf1fc29b42897e63a7c4c4b6fb0ffef54a3;p=people%2Fms%2Flibloc.git importer: Also import networks that are smaller than /48 or /24 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 --- diff --git a/src/scripts/location-importer.in b/src/scripts/location-importer.in index 4b34037..080b776 100644 --- a/src/scripts/location-importer.in +++ b/src/scripts/location-importer.in @@ -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