edns.opt_list_out = NULL;
edns.opt_list_inplace_cb_out = NULL;
verbose(VERB_ALGO, "query with bad edns version.");
- log_addr( VERB_CLIENT, "from",&repinfo->remote_addr
- , repinfo->remote_addrlen);
+ log_addr(VERB_CLIENT, "from", &repinfo->client_addr,
+ repinfo->client_addrlen);
extended_error_encode(c->buffer, EDNS_RCODE_BADVERS, &qinfo,
*(uint16_t*)(void *)sldns_buffer_begin(c->buffer),
sldns_buffer_read_u16_at(c->buffer, 2), 0, &edns);
edns.udp_size = NORMAL_UDP_SIZE;
}
}
+
/* "if, else if" sequence below deals with downstream DNS Cookies */
- if (acl != acl_allow_cookie)
+ if(acl != acl_allow_cookie)
; /* pass; No cookie downstream processing whatsoever */
- else if (edns.cookie_valid)
+ else if(edns.cookie_valid)
; /* pass; Valid cookie is good! */
- else if (c->type != comm_udp)
+ else if(c->type != comm_udp)
; /* pass; Stateful transport */
- else if (edns.cookie_present) {
+ else if(edns.cookie_present) {
/* Cookie present, but not valid: Cookie was bad! */
extended_error_encode(c->buffer,
LDNS_EXT_RCODE_BADCOOKIE, &qinfo,
regional_free_all(worker->scratchpad);
goto send_reply;
} else {
- /* Cookie requered, but no cookie present on UDP */
+ /* Cookie required, but no cookie present on UDP */
verbose(VERB_ALGO, "worker request: "
"need cookie or stateful transport");
log_addr(VERB_ALGO, "from",&repinfo->remote_addr
regional_free_all(worker->scratchpad);
goto send_reply;
}
+
if(edns.udp_size > worker->daemon->cfg->max_udp_size &&
c->type == comm_udp) {
verbose(VERB_QUERY,
sldns_buffer_flip(pkt);
}
-void
-extended_error_encode(sldns_buffer* buf, uint16_t rcode, struct query_info* qinfo,
- uint16_t qid, uint16_t qflags, uint16_t xflags, struct edns_data* edns)
+void
+extended_error_encode(sldns_buffer* buf, uint16_t rcode,
+ struct query_info* qinfo, uint16_t qid, uint16_t qflags,
+ uint16_t xflags, struct edns_data* edns)
{
uint16_t flags;
}
}
-void
+void
error_encode(sldns_buffer* buf, int r, struct query_info* qinfo,
uint16_t qid, uint16_t qflags, struct edns_data* edns)
{
- extended_error_encode(buf, (r & 0x000F), qinfo, qid, qflags
- , (r & 0xFFF0), edns);
+ extended_error_encode(buf, (r & 0x000F), qinfo, qid, qflags,
+ (r & 0xFFF0), edns);
}
-
*/
void attach_edns_record(struct sldns_buffer* pkt, struct edns_data* edns);
-/**
+/**
* Encode an error. With QR and RA set.
*
* @param pkt: where to store the packet.
void error_encode(struct sldns_buffer* pkt, int r, struct query_info* qinfo,
uint16_t qid, uint16_t qflags, struct edns_data* edns);
-/**
+/**
* Encode an extended error. With QR and RA set.
*
* @param pkt: where to store the packet.
* @param xflags: extra flags to set (such as for example BIT_AA and/or BIT_TC)
* @param edns: if not NULL, this is the query edns info,
* and an edns reply is attached. Only attached if EDNS record fits reply.
- * Without edns extended errors (i.e. > 15 )will not be conveyed.
+ * Without edns extended errors (i.e. > 15) will not be conveyed.
*/
void extended_error_encode(struct sldns_buffer* pkt, uint16_t rcode,
struct query_info* qinfo, uint16_t qid, uint16_t qflags,