mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 00:02:04 -04:00
set msg->rdclass even if question section is empty
This commit is contained in:
parent
7fba8470c7
commit
57cf89b149
1 changed files with 11 additions and 0 deletions
|
|
@ -923,6 +923,17 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
|
|||
rdtype = isc_buffer_getuint16(source);
|
||||
rdclass = isc_buffer_getuint16(source);
|
||||
|
||||
/*
|
||||
* If there was no question section, we may not yet have
|
||||
* established a class. Do so now.
|
||||
*/
|
||||
if (msg->state == DNS_SECTION_ANY) {
|
||||
if (rdclass == 0 || rdclass == dns_rdataclass_any)
|
||||
return (DNS_R_FORMERR);
|
||||
msg->rdclass = rdclass;
|
||||
msg->state = DNS_SECTION_QUESTION;
|
||||
}
|
||||
|
||||
/*
|
||||
* If this class is different than the one in the question
|
||||
* section, bail.
|
||||
|
|
|
|||
Loading…
Reference in a new issue