Commit e774c8a8 authored by Jan Kadlec's avatar Jan Kadlec

ixfr: Fixed fallback to AXFR for AXFR-style IXFR.

parent bebafa83
......@@ -684,14 +684,17 @@ int ixfr_process_answer(knot_pkt_t *pkt, struct answer_data *adata)
return NS_PROC_FAIL;
}
if (!ixfr_enough_data(pkt)) {
return NS_PROC_FAIL;
}
if (adata->ext == NULL) {
/* Check for AXFR-style IXFR on first run. */
if (!ixfr_enough_data(pkt)) {
return NS_PROC_FAIL;
}
/* Check for AXFR-style IXFR. */
if (ixfr_is_axfr(pkt)) {
IXFRIN_LOG(LOG_NOTICE, "fallback to AXFR");
return axfr_answer_process(pkt, adata);
if (ixfr_is_axfr(pkt)) {
IXFRIN_LOG(LOG_NOTICE, "fallback to AXFR");
knot_wire_set_opcode(adata->param->query->wire, KNOT_RRTYPE_AXFR);
  • I don't like this. It probably doesn't cause any problems (who knows), but the incoming query should be read-only IMHO. Isn't it better to add some flag to the answer_data structure?

  • AFAIK this is not incoming query, it's the query the server sent to get the transfer.

  • Well OK, but nevertheless, you're not processing the query, but the answer. If the query's OPCODE is needed somewhere else (now or later), this will be a problem.

  • I've tried to code a solution with a flag and it was a mess. What does @mvavrusa say?

  • This is bad, and will fail for example a TSIG check. In query procesing, the "qdata.pkt_type" governs how the query should be processed, and you can alter it during the processing. You should do the same thing with "answer_data", there's no better way.

Please register or sign in to reply
return axfr_answer_process(pkt, adata);
}
}
/* Check RCODE. */
......
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