Commit 057422c5 authored by Lubos Slovak's avatar Lubos Slovak

Minor changes

parent 9b9d4383
......@@ -42,6 +42,10 @@ int dnslib_query_set_question(dnslib_packet_t *query,
query->question.qname = question->qname;
query->question.qclass = question->qclass;
query->question.qtype = question->qtype;
query->header.qdcount = 1;
// convert the Question to wire format right away
dnslib_packet_question_to_wire(query);
return DNSLIB_EOK;
}
......@@ -9,6 +9,8 @@
#include "dnslib/error.h"
#include "knot/other/log.h"
/*----------------------------------------------------------------------------*/
/* Non-API functions */
/*----------------------------------------------------------------------------*/
static int axfrin_create_query(const dnslib_dname_t *qname, uint16_t qtype,
......@@ -65,6 +67,9 @@ static int axfrin_create_query(const dnslib_dname_t *qname, uint16_t qtype,
memcpy(buffer, wire, wire_size);
*size = wire_size;
debug_ns("Created query of size %zu.\n", *size);
dnslib_packet_dump(pkt);
dnslib_packet_free(&pkt);
return KNOT_EOK;
......@@ -77,6 +82,8 @@ static uint32_t axfrin_serial_difference(uint32_t local, uint32_t remote)
return (((int64_t)remote - local) % ((int64_t)1 << 32));
}
/*----------------------------------------------------------------------------*/
/* API functions */
/*----------------------------------------------------------------------------*/
int axfrin_create_soa_query(const dnslib_dname_t *zone_name, uint8_t *buffer,
......
......@@ -2087,8 +2087,7 @@ ns_nameserver_t *ns_create()
uint8_t *error_wire = NULL;
if (dnslib_packet_to_wire(err, &error_wire, &ns->err_resp_size)
!= 0) {
if (dnslib_packet_to_wire(err, &error_wire, &ns->err_resp_size) != 0) {
log_answer_error("Error while converting "
"default error response to "
"wire format \n");
......
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