2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

When returning DNS_R_CNAME or DNS_R_DNAME as the result of an ANY or SIG

query, the resolver failed to setup the return event's rdatasets, causing an
assertion failure in the query code.  [RT #881]

The fix includes the addition of the DNS_NAMEATTR_CHAINING attribute,
and the removal of the DNS_NAMEATTR_CNAME and DNS_NAMEATTR_DNAME attributes,
because they were not used anywhere in the current source.
This commit is contained in:
Bob Halley
2001-02-19 08:54:54 +00:00
parent 56b086c18d
commit 1e50dad10d
3 changed files with 22 additions and 6 deletions

View File

@@ -1,4 +1,9 @@
744. [bug] When returning DNS_R_CNAME or DNS_R_DNAME as the
result of an ANY or SIG query, the resolver failed
to setup the return event's rdatasets, causing an
assertion failure in the query code. [RT #881]
743. [bug] Receiving a large number of certain malformed
answers could cause named to stop responding.
[RT #861]

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: name.h,v 1.90 2001/02/02 22:08:27 gson Exp $ */
/* $Id: name.h,v 1.91 2001/02/19 08:54:54 halley Exp $ */
#ifndef DNS_NAME_H
#define DNS_NAME_H 1
@@ -207,8 +207,7 @@ struct dns_name {
#define DNS_NAMEATTR_CACHE 0x0100 /* Used by resolver. */
#define DNS_NAMEATTR_ANSWER 0x0200 /* Used by resolver. */
#define DNS_NAMEATTR_NCACHE 0x0400 /* Used by resolver. */
#define DNS_NAMEATTR_CNAME 0x0800 /* Used by message. */
#define DNS_NAMEATTR_DNAME 0x1000 /* Used by message. */
#define DNS_NAMEATTR_CHAINING 0x0800 /* Used by resolver. */
extern dns_name_t *dns_rootname;
extern dns_name_t *dns_wildcardname;

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: resolver.c,v 1.202 2001/02/18 21:19:43 bwelling Exp $ */
/* $Id: resolver.c,v 1.203 2001/02/19 08:54:52 halley Exp $ */
#include <config.h>
@@ -2670,8 +2670,16 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
if (result != ISC_R_SUCCESS)
return (result);
anodep = &event->node;
if (fctx->type != dns_rdatatype_any &&
fctx->type != dns_rdatatype_sig) {
/*
* If this is an ANY or SIG query, we're not going
* to return any rdatasets, unless we encountered
* a CNAME or DNAME as "the answer". In this case,
* we're going to return DNS_R_CNAME or DNS_R_DNAME
* and we must set up the rdatasets.
*/
if ((fctx->type != dns_rdatatype_any &&
fctx->type != dns_rdatatype_sig) ||
(name->attributes & DNS_NAMEATTR_CHAINING) != 0) {
ardataset = event->rdataset;
asigrdataset = event->sigrdataset;
}
@@ -3699,6 +3707,8 @@ answer_response(fetchctx_t *fctx) {
*/
if (want_chaining) {
chaining = ISC_TRUE;
name->attributes |=
DNS_NAMEATTR_CHAINING;
rdataset->attributes |=
DNS_RDATASETATTR_CHAINING;
qname = &tname;
@@ -3810,6 +3820,8 @@ answer_response(fetchctx_t *fctx) {
if (result != ISC_R_SUCCESS)
return (result);
chaining = ISC_TRUE;
name->attributes |=
DNS_NAMEATTR_CHAINING;
rdataset->attributes |=
DNS_RDATASETATTR_CHAINING;
qname = dns_fixedname_name(