Skip to content
Snippets Groups Projects
Commit a41532e5 authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

lib/resolve: never read rcode if answer not exists

parent 22965f08
No related branches found
No related tags found
No related merge requests found
......@@ -471,7 +471,7 @@ int kr_resolve_consume(struct kr_request *request, const struct sockaddr *src, k
}
}
/* Do not complete NS address resolution on soft-fail. */
const int rcode = knot_wire_get_rcode(packet->wire);
const int rcode = packet ? knot_wire_get_rcode(packet->wire) : 0;
if (rcode != KNOT_RCODE_SERVFAIL && rcode != KNOT_RCODE_REFUSED) {
qry->flags &= ~(QUERY_AWAIT_IPV6|QUERY_AWAIT_IPV4);
} else { /* Penalize SERVFAILs. */
......
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