Changeset 1926
- Timestamp:
- 01/28/11 12:09:22 (2 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/slavecommunicator.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/slavecommunicator.cc
r1893 r1926 82 82 dnssecZone=true; 83 83 haveNSEC3=dk.getNSEC3PARAM(domain, &ns3pr, &narrow); 84 string hashed; 84 } 85 86 if(dnssecZone) { 85 87 if(!haveNSEC3) 86 cerr<<"Adding NSEC ordering information"<<endl;87 else if(!narrow)88 cerr<<"Adding NSEC3 hashed ordering information for '"<<domain<<"'"<<endl;89 else90 cerr<<"Erasing NSEC3 ordering since we are narrow, only setting 'auth' fields"<<endl;91 } 88 L<<Logger::Info<<"Adding NSEC ordering information"<<endl; 89 else if(!narrow) 90 L<<Logger::Info<<"Adding NSEC3 hashed ordering information for '"<<domain<<"'"<<endl; 91 else 92 L<<Logger::Info<<"Erasing NSEC3 ordering since we are narrow, only setting 'auth' fields"<<endl; 93 } 92 94 93 95 if(!B->getDomainInfo(domain, di) || !di.backend) { … … 111 113 continue; 112 114 } 113 if(dnssecZone) {114 if(i->qtype.getCode() == QType::NS && !pdns_iequals(i->qname, domain))115 nsset.insert(i->qname);116 qnames.insert(i->qname);117 }115 116 if(i->qtype.getCode() == QType::NS && !pdns_iequals(i->qname, domain)) 117 nsset.insert(i->qname); 118 qnames.insert(i->qname); 119 118 120 i->domain_id=domain_id; 119 121 if(i->qtype.getCode()>=1024) … … 123 125 } 124 126 } 125 if(dnssecZone) {126 string hashed;127 BOOST_FOREACH(const string& qname, qnames)128 {129 string shorter(qname);130 bool auth=true;131 do {132 if(nsset.count(shorter)) {133 auth=false;134 break;135 }136 }while(chopOff(shorter));127 128 string hashed; 129 BOOST_FOREACH(const string& qname, qnames) 130 { 131 string shorter(qname); 132 bool auth=true; 133 do { 134 if(nsset.count(shorter)) { 135 auth=false; 136 break; 137 } 138 }while(chopOff(shorter)); 137 139 138 if(!haveNSEC3) // NSEC 139 di.backend->updateDNSSECOrderAndAuth(domain_id, domain, qname, auth); 140 else { 141 if(!narrow) { 142 hashed=toLower(toBase32Hex(hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, qname))); 143 cerr<<"'"<<qname<<"' -> '"<< hashed <<"'"<<endl; 144 } 145 di.backend->updateDNSSECOrderAndAuthAbsolute(domain_id, qname, hashed, auth); 140 if(dnssecZone && !haveNSEC3) // NSEC 141 di.backend->updateDNSSECOrderAndAuth(domain_id, domain, qname, auth); 142 else { 143 if(dnssecZone && !narrow) { 144 hashed=toLower(toBase32Hex(hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, qname))); 146 145 } 146 di.backend->updateDNSSECOrderAndAuthAbsolute(domain_id, qname, hashed, auth); // this should always be done 147 147 } 148 148 } 149 149 150 150 di.backend->commitTransaction(); 151 151 di.backend->setFresh(domain_id);