From: bert hubert Date: Thu, 23 Feb 2017 12:30:37 +0000 (+0100) Subject: Merge branch 'master' into dnsrr X-Git-Tag: rec-4.1.0-alpha1~253^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afad964a6e4921f91ed8859907abed40307b566b;p=thirdparty%2Fpdns.git Merge branch 'master' into dnsrr --- afad964a6e4921f91ed8859907abed40307b566b diff --cc pdns/dnsparser.cc index ef6e13e3b2,16d1b8aae9..8f6baa7cbe --- a/pdns/dnsparser.cc +++ b/pdns/dnsparser.cc @@@ -210,19 -211,7 +210,19 @@@ DNSRecord::DNSRecord(const DNSResourceR d_content = std::shared_ptr(DNSRecordContent::mastermake(d_type, rr.qclass, rr.content)); } +// If you call this and you are not parsing a packet coming from a socket, you are doing it wrong. +DNSResourceRecord DNSResourceRecord::fromWire(const DNSRecord& d) { + DNSResourceRecord rr; + rr.qname = d.d_name; + rr.qtype = QType(d.d_type); + rr.ttl = d.d_ttl; + rr.content = d.d_content->getZoneRepresentation(true); + rr.auth = false; + rr.qclass = d.d_class; + return rr; +} + - void MOADNSParser::init(const char *packet, unsigned int len) + void MOADNSParser::init(bool query, const char *packet, unsigned int len) { if(len < sizeof(dnsheader)) throw MOADNSException("Packet shorter than minimal header"); diff --cc pdns/mastercommunicator.cc index 930304149d,f4c343c123..d50928000a --- a/pdns/mastercommunicator.cc +++ b/pdns/mastercommunicator.cc @@@ -49,30 -49,32 +49,33 @@@ void CommunicatorClass::queueNotifyDoma DNSResourceRecord rr; FindNS fns; - di.backend->lookup(QType(QType::NS), di.zone); - while(di.backend->get(rr)) - nsset.insert(rr.content); - - for(set::const_iterator j=nsset.begin();j!=nsset.end();++j) { - vector nsips=fns.lookup(DNSName(*j), di.backend); - if(nsips.empty()) - L<::const_iterator k=nsips.begin();k!=nsips.end();++k) { - const ComboAddress caIp(*k, 53); - if(!d_preventSelfNotification || !AddressIsUs(caIp)) { - if(!d_onlyNotify.match(&caIp)) - L<lookup(QType(QType::NS),domain); + while(B->get(rr)) + nsset.insert(rr.content); + + for(set::const_iterator j=nsset.begin();j!=nsset.end();++j) { + vector nsips=fns.lookup(DNSName(*j), B); + if(nsips.empty()) + L<::const_iterator k=nsips.begin();k!=nsips.end();++k) { + const ComboAddress caIp(*k, 53); + if(!d_preventSelfNotification || !AddressIsUs(caIp)) { + if(!d_onlyNotify.match(&caIp)) + L<::const_iterator j=ips.begin();j!=ips.end();++j) { - L<::const_iterator j=ips.begin();j!=ips.end();++j) { + L< alsoNotify(d_alsoNotify);