From: Mukund Sivaraman Date: Mon, 10 Sep 2012 04:07:26 +0000 (+0530) Subject: [2108] Fix context check when adding a CNAME record X-Git-Tag: trac2351_base~70^2~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=083e6836264daff5da8aa95dff7927d0f37f0e43;p=thirdparty%2Fkea.git [2108] Fix context check when adding a CNAME record --- diff --git a/src/lib/datasrc/memory/memory_client.cc b/src/lib/datasrc/memory/memory_client.cc index 57138eedd3..e21fd48418 100644 --- a/src/lib/datasrc/memory/memory_client.cc +++ b/src/lib/datasrc/memory/memory_client.cc @@ -178,11 +178,14 @@ public: // owner name except with NSEC, which is the only RR that can coexist // with CNAME (and also RRSIG, which is handled separately) if (rrset.getType() == RRType::CNAME()) { - if (RdataSet::find(set, RRType::NSEC()) != NULL) { - LOG_ERROR(logger, DATASRC_MEM_CNAME_TO_NONEMPTY). - arg(rrset.getName()); - isc_throw(AddError, "CNAME can't be added with other data for " - << rrset.getName()); + for (const RdataSet* sp = set; sp != NULL; sp = sp->getNext()) { + if (sp->type != RRType::NSEC()) { + LOG_ERROR(logger, DATASRC_MEM_CNAME_TO_NONEMPTY). + arg(rrset.getName()); + isc_throw(AddError, "CNAME can't be added with " + << sp->type << " RRType for " + << rrset.getName()); + } } } else if ((rrset.getType() != RRType::NSEC()) && (RdataSet::find(set, RRType::CNAME()) != NULL)) {