`GeoipDb::new_from_legacy_format` will always fail cause the databases containing ASN contain zeros
Working on tpo/network-health/margot#14 (closed), i've built the geoip databases using tor/scripts/maint/geoip/geoip-db-tool with ASN information, which are the same content as geoip(6)-plus-asn at https://tpo.pages.torproject.net/network-health/metrics/geoip-data/.
When i try to create the GeoipDb using new_from_legacy_format
, i get got an ASN with value 0
, because NetDefn
return error when the asn is zero.
I think that instead, NetDefn
should return 0 or None and leave to the application using tor-geoip to decide what to do with such values. Or have an alternative NetDefn
that does this.
Edited by juga