Commit d5a8a75c authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[1551] allow adding NSEC after CNAME for the same name.

parent 88b907df
......@@ -190,7 +190,8 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
isc_throw(AddError, "CNAME can't be added with other data for "
<< rrset->getName());
}
} else if (domain->find(RRType::CNAME()) != domain->end()) {
} else if (rrset->getType() != RRType::NSEC() &&
domain->find(RRType::CNAME()) != domain->end()) {
LOG_ERROR(logger, DATASRC_MEM_CNAME_COEXIST).arg(rrset->getName());
isc_throw(AddError, "CNAME and " << rrset->getType() <<
" can't coexist for " << rrset->getName());
......
......@@ -559,6 +559,18 @@ TEST_F(InMemoryZoneFinderTest, addOtherThenCNAME) {
EXPECT_THROW(zone_finder_.add(rr_cname_), InMemoryZoneFinder::AddError);
}
TEST_F(InMemoryZoneFinderTest, addCNAMEThenDNSSECRecords) {
// CNAME and RRSIG can coexist
EXPECT_EQ(SUCCESS, zone_finder_.add(rr_cname_));
zone_finder_.add(textToRRset("cname.example.org. 300 IN RRSIG CNAME 5 3 "
"3600 20000101000000 20000201000000 12345 "
"example.org. FAKEFAKEFAKE"));
// Same for NSEC
zone_finder_.add(textToRRset("cname.example.org. 300 IN NSEC "
"dname.example.org. CNAME RRSIG NSEC"));
}
TEST_F(InMemoryZoneFinderTest, findCNAME) {
// install CNAME RR
EXPECT_EQ(SUCCESS, zone_finder_.add(rr_cname_));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment