Commit 7df6c41b authored by Daniel Salzman's avatar Daniel Salzman

nameserver: fix process_query_qname_case_restore parameters order

parent 44f7f034
......@@ -405,7 +405,7 @@ static int process_query_err(knot_layer_t *ctx, knot_pkt_t *pkt)
knot_wire_clear_cd(pkt->wire); // TODO: should be inside knot_pkt_init_response.
/* Restore original QNAME. */
process_query_qname_case_restore(qdata, pkt);
process_query_qname_case_restore(pkt, qdata);
/* Add OPT and TSIG (best effort, send reply anyway if fails). */
if (pkt->current != KNOT_ADDITIONAL) {
......@@ -532,7 +532,7 @@ static int process_query_out(knot_layer_t *ctx, knot_pkt_t *pkt)
if (next_state == KNOT_STATE_DONE || next_state == KNOT_STATE_PRODUCE) {
/* Restore original QNAME. */
process_query_qname_case_restore(qdata, pkt);
process_query_qname_case_restore(pkt, qdata);
if (pkt->current != KNOT_ADDITIONAL) {
knot_pkt_begin(pkt, KNOT_ADDITIONAL);
......@@ -644,7 +644,7 @@ int process_query_verify(struct query_data *qdata)
ctx->tsig_digestlen = knot_tsig_rdata_mac_length(query->tsig_rr);
/* Checking query. */
process_query_qname_case_restore(qdata, query);
process_query_qname_case_restore(query, qdata);
int ret = knot_tsig_server_check(query->tsig_rr, query->wire,
query->size, &ctx->tsig_key);
process_query_qname_case_lower(query);
......@@ -732,7 +732,7 @@ fail:
return ret;
}
void process_query_qname_case_restore(struct query_data *qdata, knot_pkt_t *pkt)
void process_query_qname_case_restore(knot_pkt_t *pkt, struct query_data *qdata)
{
/* If original QNAME is empty, Query is either unparsed or for root domain.
* Either way, letter case doesn't matter. */
......
......@@ -133,10 +133,10 @@ int process_query_sign_response(knot_pkt_t *pkt, struct query_data *qdata);
/*!
* \brief Restore QNAME letter case.
*
* \param qdata Query data.
* \param pkt Incoming message.
* \param qdata Query data.
*/
void process_query_qname_case_restore(struct query_data *qdata, knot_pkt_t *pkt);
void process_query_qname_case_restore(knot_pkt_t *pkt, struct query_data *qdata);
/*!
* \brief Convert QNAME to lowercase format for processing.
......
......@@ -125,7 +125,7 @@ static int process_bulk(zone_t *zone, list_t *requests, zone_update_t *up)
return ret;
}
process_query_qname_case_restore(&qdata, req->query);
process_query_qname_case_restore(req->query, &qdata);
}
return KNOT_EOK;
......@@ -420,7 +420,7 @@ int update_process_query(knot_pkt_t *pkt, struct query_data *qdata)
NS_NEED_ZONE_CONTENTS(qdata, KNOT_RCODE_SERVFAIL);
/* Restore original QNAME for DDNS ACL checks. */
process_query_qname_case_restore(qdata, qdata->query);
process_query_qname_case_restore(qdata->query, qdata);
/* Store update into DDNS queue. */
int ret = zone_update_enqueue(zone, qdata->query, qdata->param);
if (ret != KNOT_EOK) {
......
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