When waiting for a TCP request, receiving a response

instead caused an assertion failure
This commit is contained in:
Andreas Gustafsson
1999-12-20 23:06:17 +00:00
parent d84ce5d5c6
commit 12cc22fc73
+11 -1
View File
@@ -519,7 +519,17 @@ client_request(isc_task_t *task, isc_event_t *event) {
ns_client_error(client, result);
return;
}
INSIST((client->message->flags & DNS_MESSAGEFLAG_QR) == 0);
/*
* We expect a query, not a response. Unexpected UDP responses
* are discarded early by the dispatcher, but TCP responses
* bypass the dispatcher and must be discarded here.
*/
if ((client->message->flags & DNS_MESSAGEFLAG_QR) != 0) {
CTRACE("unexpected response");
ns_client_next(client, DNS_R_FORMERR);
return;
}
/*
* Deal with EDNS.