mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-15 22:09:31 -04:00
1209. [bug] Dig, host, nslookup were not checking the message ids
on the responses. [RT #2454]
This commit is contained in:
parent
fcde24ec36
commit
e53a5a116f
2 changed files with 36 additions and 1 deletions
3
CHANGES
3
CHANGES
|
|
@ -1,3 +1,6 @@
|
|||
1209. [bug] Dig, host, nslookup were not checking the message ids
|
||||
on the responses. [RT #2454]
|
||||
|
||||
1208. [bug] dns_master_load*() failed to log a error message if
|
||||
an error was detected when parsing the ownername of
|
||||
a record. [RT #2448]
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: dighost.c,v 1.240 2002/02/20 03:32:56 marka Exp $ */
|
||||
/* $Id: dighost.c,v 1.241 2002/02/21 04:48:00 marka Exp $ */
|
||||
|
||||
/*
|
||||
* Notice to programmers: Do not use this code as an example of how to
|
||||
|
|
@ -2118,6 +2118,8 @@ recv_done(isc_task_t *task, isc_event_t *event) {
|
|||
dig_lookup_t *n, *l;
|
||||
isc_boolean_t docancel = ISC_FALSE;
|
||||
unsigned int parseflags;
|
||||
dns_messageid_t id;
|
||||
unsigned int msgflags;
|
||||
|
||||
UNUSED(task);
|
||||
INSIST(!free_now);
|
||||
|
|
@ -2172,6 +2174,36 @@ recv_done(isc_task_t *task, isc_event_t *event) {
|
|||
|
||||
b = ISC_LIST_HEAD(sevent->bufferlist);
|
||||
ISC_LIST_DEQUEUE(sevent->bufferlist, &query->recvbuf, link);
|
||||
|
||||
result = dns_message_peekheader(b, &id, &msgflags);
|
||||
if (result != ISC_R_SUCCESS || l->sendmsg->id != id) {
|
||||
if (l->tcp_mode) {
|
||||
if (result == ISC_R_SUCCESS)
|
||||
printf(";; ERROR: ID mismatch\n");
|
||||
else
|
||||
printf(";; ERROR: runt message\n");
|
||||
isc_event_free(&event);
|
||||
clear_query(query);
|
||||
check_next_lookup(l);
|
||||
UNLOCK_LOOKUP;
|
||||
return;
|
||||
}
|
||||
if (result == ISC_R_SUCCESS)
|
||||
printf(";; Warning: ID mismatch\n");
|
||||
else
|
||||
printf(";; Warning: runt message received\n");
|
||||
isc_buffer_invalidate(&query->recvbuf);
|
||||
isc_buffer_init(&query->recvbuf, query->recvspace, COMMSIZE);
|
||||
ISC_LIST_ENQUEUE(query->recvlist, &query->recvbuf, link);
|
||||
result = isc_socket_recvv(query->sock, &query->recvlist, 1,
|
||||
global_task, recv_done, query);
|
||||
check_result(result, "isc_socket_recvv");
|
||||
recvcount++;
|
||||
isc_event_free(&event);
|
||||
UNLOCK_LOOKUP;
|
||||
return;
|
||||
}
|
||||
|
||||
result = dns_message_create(mctx, DNS_MESSAGE_INTENTPARSE, &msg);
|
||||
check_result(result, "dns_message_create");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue