Skip to content
Snippets Groups Projects
Commit 4d277301 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Merge branch 'kdig_check_qr' into 'master'

kdig: checking QR bit on response

Closes #512

See merge request !699
parents bb2ba911 18407772
Branches
Tags
1 merge request!699kdig: checking QR bit on response
Pipeline #3025 passed with stages
in 15 minutes and 20 seconds
...@@ -450,6 +450,13 @@ static bool check_reply_id(const knot_pkt_t *reply, ...@@ -450,6 +450,13 @@ static bool check_reply_id(const knot_pkt_t *reply,
return true; return true;
} }
static void check_reply_qr(const knot_pkt_t *reply)
{
if (!knot_wire_get_qr(reply->wire)) {
WARN("response QR bit not set\n");
}
}
static void check_reply_question(const knot_pkt_t *reply, static void check_reply_question(const knot_pkt_t *reply,
const knot_pkt_t *query) const knot_pkt_t *query)
{ {
...@@ -648,6 +655,9 @@ static int process_query_packet(const knot_pkt_t *query, ...@@ -648,6 +655,9 @@ static int process_query_packet(const knot_pkt_t *query,
// Check for question sections equality. // Check for question sections equality.
check_reply_question(reply, query); check_reply_question(reply, query);
// Check QR bit
check_reply_qr(reply);
// Print reply packet. // Print reply packet.
print_packet(reply, net, in_len, time_diff_ms(&t_query, &t_end), 0, print_packet(reply, net, in_len, time_diff_ms(&t_query, &t_end), 0,
true, style); true, style);
...@@ -884,6 +894,8 @@ static int process_xfr_packet(const knot_pkt_t *query, ...@@ -884,6 +894,8 @@ static int process_xfr_packet(const knot_pkt_t *query,
return 0; return 0;
} }
check_reply_qr(reply);
// The first message has a special treatment. // The first message has a special treatment.
if (msg_count == 0) { if (msg_count == 0) {
// Verify 1. signature if a key was specified. // Verify 1. signature if a key was specified.
......
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