Unbound: dnsbl_module: allow host bits during parsing of ip network

ipaddress.ip_network is strict by default, but model validation allows host bits in a CIDR notation, so turn
strict parsing off.
This commit is contained in:
Stephan de Wit 2023-02-28 14:25:37 +01:00
parent 331b03a21a
commit 194d50891b

View File

@ -280,7 +280,7 @@ class DNSBL:
if type(self.dnsbl['data'][key]['source_net']) is list:
for item in self.dnsbl['data'][key]['source_net']:
try:
source_nets.append(ipaddress.ip_network(item))
source_nets.append(ipaddress.ip_network(item, False))
except ValueError:
log_err("dnsbl_module: unparsable network %s in %s" % (key, item))
self.dnsbl['data'][key]['source_net'] = source_nets