Skip to content
Snippets Groups Projects
Commit 55049f60 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

Merge branch 'ixfr-master-fallback' into 'master'

IXFR: falback to AXFR master-side fix

When Knot master replied to IXFR query by AXFR-style IXFR, the response was wrong in two ways:
1. Header was cleared: no ID, no QR flag
2. QTYPE was changed to AXFR

Both are wrong. The header must be set properly and the IXFR QTYPE must be preserved even if the response has the AXFR format (that's the way to distinguish it), see [RFC1995, Section 4](http://tools.ietf.org/html/rfc1995#section-4).

I removed these changes to the packet. But I'm not totally sure that there is no problem now, because the packet-processing is too obscure. @mvavrusa should review this definitely.

Tests pending.

See merge request !278
parents b7e955a7 d5992c45
No related branches found
No related tags found
No related merge requests found
......@@ -618,7 +618,6 @@ int ixfr_query(knot_pkt_t *pkt, struct query_data *qdata)
int ret = KNOT_EOK;
struct timeval now = {0};
struct ixfr_proc *ixfr = (struct ixfr_proc*)qdata->ext;
knot_pkt_t *query = qdata->query;
/* If IXFR is disabled, respond with SOA. */
if (qdata->param->proc_flags & NS_QUERY_NO_IXFR) {
......@@ -641,10 +640,6 @@ int ixfr_query(knot_pkt_t *pkt, struct query_data *qdata)
case KNOT_ERANGE: /* No history -> AXFR. */
case KNOT_ENOENT:
IXFROUT_LOG(LOG_INFO, "incomplete history, fallback to AXFR");
knot_pkt_clear(pkt);
knot_pkt_put_question(pkt, knot_pkt_qname(query),
knot_pkt_qclass(query),
KNOT_RRTYPE_AXFR);
qdata->packet_type = KNOT_QUERY_AXFR; /* Solve as AXFR. */
return axfr_query_process(pkt, qdata);
default: /* Server errors. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment