From: W.C.A. Wijngaards Date: Thu, 14 Jan 2021 12:49:42 +0000 (+0100) Subject: - fix that testdata/rpz_clientip.rpl trigger tests succeed. X-Git-Tag: release-1.14.0rc1~62^2~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15b46257e1aee908d83de1b0342c620d0c6da32c;p=thirdparty%2Funbound.git - fix that testdata/rpz_clientip.rpl trigger tests succeed. --- diff --git a/services/rpz.c b/services/rpz.c index 0d825238f..b89583e8e 100644 --- a/services/rpz.c +++ b/services/rpz.c @@ -1356,7 +1356,7 @@ rpz_resolve_client_action_and_zone(struct auth_zones* az, struct query_info* qin z = rpz_find_zone(r->local_zones, qinfo->qname, qinfo->qname_len, qinfo->qclass, 0, 0, 0); node = rpz_ipbased_trigger_lookup(r->client_set, &repinfo->addr, repinfo->addrlen); - if(z && r->action_override == RPZ_DISABLED_ACTION) { + if((z || node) && r->action_override == RPZ_DISABLED_ACTION) { if(r->log) log_rpz_apply(z->name, r->action_override, @@ -1366,7 +1366,7 @@ rpz_resolve_client_action_and_zone(struct auth_zones* az, struct query_info* qin lock_rw_unlock(&z->lock); z = NULL; } - if(z) { + if(z || node) { break; } else { if(node != NULL) { @@ -1913,7 +1913,7 @@ rpz_apply_maybe_clientip_trigger(struct auth_zones* az, struct module_env* env, struct clientip_synthesized_rr* node = rpz_resolve_client_action_and_zone( az, qinfo, repinfo, taglist, taglen, stats, z_out, a_out, r_out); - client_action = node == NULL ? RPZ_INVALID_ACTION : node->action; + client_action = ((node == NULL) ? RPZ_INVALID_ACTION : node->action); verbose(VERB_ALGO, "rpz: qname trigger: client action=%s", rpz_action_to_string(client_action));