Deleted Added
full compact
respip.c (366095) respip.c (368693)
1/*
2 * respip/respip.c - filtering response IP module
3 */
4
5/**
6 * \file
7 *
8 * This file contains a module that inspects a result of recursive resolution

--- 900 unchanged lines hidden (view full) ---

909 struct respip_set* ipset = NULL;
910 size_t rrset_id = 0;
911 enum respip_action action = respip_none;
912 int tag = -1;
913 struct resp_addr* raddr = NULL;
914 int ret = 1;
915 struct ub_packed_rrset_key* redirect_rrset = NULL;
916 struct rpz* r;
1/*
2 * respip/respip.c - filtering response IP module
3 */
4
5/**
6 * \file
7 *
8 * This file contains a module that inspects a result of recursive resolution

--- 900 unchanged lines hidden (view full) ---

909 struct respip_set* ipset = NULL;
910 size_t rrset_id = 0;
911 enum respip_action action = respip_none;
912 int tag = -1;
913 struct resp_addr* raddr = NULL;
914 int ret = 1;
915 struct ub_packed_rrset_key* redirect_rrset = NULL;
916 struct rpz* r;
917 struct auth_zone* a;
917 struct auth_zone* a = NULL;
918 struct ub_packed_rrset_key* data = NULL;
919 int rpz_used = 0;
920 int rpz_log = 0;
921 int rpz_cname_override = 0;
922 char* log_name = NULL;
923
924 if(!cinfo)
925 goto done;

--- 178 unchanged lines hidden (view full) ---

1104 enum module_ext_state next_state = module_finished;
1105
1106 if((qstate->qinfo.qtype == LDNS_RR_TYPE_A ||
1107 qstate->qinfo.qtype == LDNS_RR_TYPE_AAAA ||
1108 qstate->qinfo.qtype == LDNS_RR_TYPE_ANY) &&
1109 qstate->return_msg && qstate->return_msg->rep) {
1110 struct reply_info* new_rep = qstate->return_msg->rep;
1111 struct ub_packed_rrset_key* alias_rrset = NULL;
918 struct ub_packed_rrset_key* data = NULL;
919 int rpz_used = 0;
920 int rpz_log = 0;
921 int rpz_cname_override = 0;
922 char* log_name = NULL;
923
924 if(!cinfo)
925 goto done;

--- 178 unchanged lines hidden (view full) ---

1104 enum module_ext_state next_state = module_finished;
1105
1106 if((qstate->qinfo.qtype == LDNS_RR_TYPE_A ||
1107 qstate->qinfo.qtype == LDNS_RR_TYPE_AAAA ||
1108 qstate->qinfo.qtype == LDNS_RR_TYPE_ANY) &&
1109 qstate->return_msg && qstate->return_msg->rep) {
1110 struct reply_info* new_rep = qstate->return_msg->rep;
1111 struct ub_packed_rrset_key* alias_rrset = NULL;
1112 struct respip_action_info actinfo = {0};
1112 struct respip_action_info actinfo = {0, 0, 0, 0, NULL, 0, NULL};
1113 actinfo.action = respip_none;
1114
1115 if(!respip_rewrite_reply(&qstate->qinfo,
1116 qstate->client_info, qstate->return_msg->rep,
1117 &new_rep, &actinfo, &alias_rrset, 0,
1118 qstate->region, qstate->env->auth_zones)) {
1119 goto servfail;
1120 }

--- 44 unchanged lines hidden (view full) ---

1165 struct reply_info** new_repp, struct regional* region,
1166 struct auth_zones* az)
1167{
1168 struct reply_info* new_rep;
1169 struct reply_info* tmp_rep = NULL; /* just a placeholder */
1170 struct ub_packed_rrset_key* alias_rrset = NULL; /* ditto */
1171 uint16_t tgt_rcode;
1172 size_t i, j;
1113 actinfo.action = respip_none;
1114
1115 if(!respip_rewrite_reply(&qstate->qinfo,
1116 qstate->client_info, qstate->return_msg->rep,
1117 &new_rep, &actinfo, &alias_rrset, 0,
1118 qstate->region, qstate->env->auth_zones)) {
1119 goto servfail;
1120 }

--- 44 unchanged lines hidden (view full) ---

1165 struct reply_info** new_repp, struct regional* region,
1166 struct auth_zones* az)
1167{
1168 struct reply_info* new_rep;
1169 struct reply_info* tmp_rep = NULL; /* just a placeholder */
1170 struct ub_packed_rrset_key* alias_rrset = NULL; /* ditto */
1171 uint16_t tgt_rcode;
1172 size_t i, j;
1173 struct respip_action_info actinfo = {0};
1173 struct respip_action_info actinfo = {0, 0, 0, 0, NULL, 0, NULL};
1174 actinfo.action = respip_none;
1175
1176 /* If the query for the CNAME target would result in an unusual rcode,
1177 * we generally translate it as a failure for the base query
1178 * (which would then be translated into SERVFAIL). The only exception
1179 * is NXDOMAIN and YXDOMAIN, which are passed to the end client(s).
1180 * The YXDOMAIN case would be rare but still possible (when
1181 * DNSSEC-validated DNAME has been cached but synthesizing CNAME

--- 161 unchanged lines hidden ---
1174 actinfo.action = respip_none;
1175
1176 /* If the query for the CNAME target would result in an unusual rcode,
1177 * we generally translate it as a failure for the base query
1178 * (which would then be translated into SERVFAIL). The only exception
1179 * is NXDOMAIN and YXDOMAIN, which are passed to the end client(s).
1180 * The YXDOMAIN case would be rare but still possible (when
1181 * DNSSEC-validated DNAME has been cached but synthesizing CNAME

--- 161 unchanged lines hidden ---