From: Michael Tremer Date: Wed, 13 May 2020 19:50:22 +0000 (+0000) Subject: location-importer: Some routers omit /24 for IPv4 X-Git-Tag: 0.9.1~56 X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Flibloc.git;a=commitdiff_plain;h=d773c1bc06c962ca0a8271fa5e74db03c0d7432f location-importer: Some routers omit /24 for IPv4 Signed-off-by: Michael Tremer --- diff --git a/src/python/location-importer.in b/src/python/location-importer.in index 08c9ed7..afd8f4a 100644 --- a/src/python/location-importer.in +++ b/src/python/location-importer.in @@ -491,6 +491,10 @@ class CLI(object): # Convert network to string network = network.decode() + # Append /24 for IPv4 addresses + if not "/" in network and not ":" in network: + network = "%s/24" % network + # Convert AS number to integer autnum = int(autnum)