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

kdig: print RCODE if failed transfer

parent 920f9b0f
No related branches found
No related tags found
No related merge requests found
......@@ -868,6 +868,23 @@ static int process_xfr_packet(const knot_pkt_t *query,
}
}
// Check for error reply.
uint16_t rcode = knot_pkt_get_ext_rcode(reply);
if (rcode != KNOT_RCODE_NOERROR) {
const char *rcode_str = "Unknown";
const knot_lookup_t *code =
knot_lookup_by_id(knot_rcode_names, rcode);
if (code != NULL) {
rcode_str = code->name;
}
ERR("server replied %s\n", rcode_str);
knot_pkt_free(&reply);
net_close(net);
return 0;
}
// Read first SOA serial.
serial = first_serial_check(reply);
......
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