Commit 65badc3b authored by Lubos Slovak's avatar Lubos Slovak

EDNS: Return error response in case of BADVERS.

parent 2959c831
......@@ -313,6 +313,11 @@ static int prepare_answer(const knot_pkt_t *query, knot_pkt_t *resp, knot_proces
return ret;
}
/* If Extended RCODE is set, do not continue with query processing. */
if (qdata->rcode_ext != 0) {
return KNOT_EMALF;
}
/* Update maximal answer size. */
bool has_limit = qdata->param->proc_flags & NS_QUERY_LIMIT_SIZE;
if (has_limit) {
......@@ -484,7 +489,8 @@ static int process_query_out(knot_pkt_t *pkt, knot_process_t *ctx)
finish:
/* Default RCODE is SERVFAIL if not specified otherwise. */
if (next_state == NS_PROC_FAIL && qdata->rcode == KNOT_RCODE_NOERROR) {
if (next_state == NS_PROC_FAIL && qdata->rcode == KNOT_RCODE_NOERROR
&& qdata->rcode_ext != KNOT_RCODE_BADVERS) {
qdata->rcode = KNOT_RCODE_SERVFAIL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment