m->s.env->mesh->num_reply_addrs--;
}
+static inline int
+mesh_is_rpz_respip_tcponly_action(struct mesh_state const* m)
+{
+ struct respip_action_info const* respip_info = m->s.respip_action_info;
+ return respip_info == NULL
+ ? 0
+ : (respip_info->rpz_used
+ && !respip_info->rpz_disabled
+ && respip_info->action == respip_truncate);
+}
+
+static inline int
+mesh_is_udp(struct mesh_reply const* r) {
+ return r->query_reply.c->type == comm_udp;
+}
+
/**
* Send reply to mesh reply entry
* @param m: mesh state to send it for.
struct timeval end_time;
struct timeval duration;
int secure;
+
+ rcode = mesh_is_udp(r) && mesh_is_rpz_respip_tcponly_action(m)
+ ? (rcode|BIT_TC) : rcode;
+
/* Copy the client's EDNS for later restore, to make sure the edns
* compare is with the correct edns options. */
struct edns_data edns_bak = r->edns;
char* rrstr;
int newzone = 0;
+ verbose(VERB_ALGO, "RPZ: insert qname trigger: %s", rpz_action_to_string(a));
+
if(a == RPZ_INVALID_ACTION) {
verbose(VERB_ALGO, "RPZ: skipping unsupported action: %s",
rpz_action_to_string(a));
return;
}
- if(a == RPZ_TCP_ONLY_ACTION) {
- verbose(VERB_ALGO, "RPZ: insert qname trigger: tcp-only");
- }
-
lock_rw_wrlock(&r->local_zones->lock);
/* exact match */
z = local_zones_find(r->local_zones, dname, dnamelen, dnamelabs,