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]

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:
Andreas Gustafsson
2001-02-20 21:56:25 +00:00
parent 5df110682c
commit 5b5656f743
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.83.2.2 2001/01/22 18:23:12 gson Exp $ */
/* $Id: name.h,v 1.83.2.3 2001/02/20 21:56:25 gson 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.187.2.6 2001/02/17 02:27:42 bwelling Exp $ */
/* $Id: resolver.c,v 1.187.2.7 2001/02/20 21:56:23 gson Exp $ */
#include <config.h>
@@ -2645,8 +2645,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;
}
@@ -3668,6 +3676,8 @@ answer_response(fetchctx_t *fctx) {
*/
if (want_chaining) {
chaining = ISC_TRUE;
name->attributes |=
DNS_NAMEATTR_CHAINING;
rdataset->attributes |=
DNS_RDATASETATTR_CHAINING;
qname = &tname;
@@ -3780,6 +3790,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(