export.py: fix exporting IP networks for crappy xt_geoip module
In contrast to the location database itself, the xt_geoip module
consumes a list of IP networks for each country, and returns after the
first match.
We therefore need to...
(a) sort IP networks by their size, allow as precise matches as possible
(b) export _any_ IP networks - including inverted subnets - to prevent
undefined overlaps
(c) do the entire thing as fast as possible, consuming as less disk
space as possible, which is why we can't just iterate over all /24
chunks
Partially fixes: #12499
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org> Signed-off-by: Peter Müller <peter.mueller@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>