From d4e613b4c8e4aaae6f009688a1f3171cab6c15b8 Mon Sep 17 00:00:00 2001 From: Stephan de Wit Date: Wed, 25 Jan 2023 10:29:26 +0100 Subject: [PATCH] Unbound: dnsbl_module: replace boolean values with integer --- .../templates/OPNsense/Unbound/core/dnsbl_module.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/opnsense/service/templates/OPNsense/Unbound/core/dnsbl_module.py b/src/opnsense/service/templates/OPNsense/Unbound/core/dnsbl_module.py index 2bdcbed13..3517616aa 100644 --- a/src/opnsense/service/templates/OPNsense/Unbound/core/dnsbl_module.py +++ b/src/opnsense/service/templates/OPNsense/Unbound/core/dnsbl_module.py @@ -221,7 +221,7 @@ def cache_cb(qinfo, qstate, rep, rcode, edns, opt_list_out, region, **kwargs): ttl = (rep.ttl - int(time.time())) if rep else 0 info = (int(time.time()), client.addr, client.family, qinfo.qtype_str, qinfo.qname_str) - security = rep.security if rep else False + security = rep.security if rep else 0 ctx.log_entry(*info, ACTION_PASS, SOURCE_CACHE, None, rcode, 0, security, ttl) return True @@ -230,7 +230,7 @@ def local_cb(qinfo, qstate, rep, rcode, edns, opt_list_out, region, **kwargs): client = kwargs['repinfo'] info = (int(time.time()), client.addr, client.family, qinfo.qtype_str, qinfo.qname_str) - security = rep.security if rep else False + security = rep.security if rep else 0 ctx.log_entry(*info, ACTION_PASS, SOURCE_LOCALDATA, None, rcode, 0, security, rep.ttl if rep else 0) return True @@ -239,7 +239,7 @@ def servfail_cb(qinfo, qstate, rep, rcode, edns, opt_list_out, region, **kwargs) client = kwargs['repinfo'] info = (int(time.time()), client.addr, client.family, qinfo.qtype_str, qinfo.qname_str) - security = rep.security if rep else False + security = rep.security if rep else 0 ctx.log_entry(*info, ACTION_DROP, SOURCE_LOCAL, None, RCODE_SERVFAIL, 0, security, rep.ttl if rep else 0) return True @@ -290,7 +290,7 @@ def operate(id, event, qstate, qdata): ttl = 0 if qstate.return_msg: - r = qstate.return_msg.rep + r = qstate.return_msg.rep if qstate.return_msg.rep else 0 dnssec = r.security rcode = r.flags & 0xF ttl = r.ttl