init ZZ dataset before using it

This commit is contained in:
2023-04-17 23:09:47 +02:00
parent c2a4b87cf1
commit 0b63ab28e0

View File

@@ -311,6 +311,9 @@ class ChaChaIPToCountryStorage:
print("Done")
#Add private network at the end
if "ZZ" not in _ipv4set:
_ipv4set["ZZ"] = IPSet_nocompact()
_ipv4set["ZZ"].update(IPRange("192.168.0.0", "192.168.255.255"))
_ipv4set["ZZ"].ForceCompact()
_ipv4set["ZZ"].update(IPRange("10.0.0.0", "10.255.255.255"))
@@ -318,6 +321,8 @@ class ChaChaIPToCountryStorage:
_ipv4set["ZZ"].update(IPRange("172.16.0.0", "172.31.255.255"))
_ipv4set["ZZ"].ForceCompact()
if DEFAULT__EnableIPV6:
if "ZZ" not in _ipv6set:
_ipv6set["ZZ"] = IPSet_nocompact()
_ipv6set["ZZ"].update(IPNetwork("fc00::/7"))
_ipv6set["ZZ"].ForceCompact()