Skip to content

Commit

Permalink
A way to fix PowerDNS#7646. It might
Browse files Browse the repository at this point in the history
not be the right place, though, but it prevents fatal exception on
unparseable A (or AAAA) addresss for nameserver addresses needed
to send notifies.
  • Loading branch information
omoerbeek committed Apr 3, 2019
1 parent adf1f52 commit 475fc44
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions pdns/communicator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,25 @@ public:

if(b) {
b->lookup(QType(QType::ANY),name);
DNSZoneRecord rr;
while(b->get(rr))
if(rr.dr.d_type == QType::A || rr.dr.d_type==QType::AAAA)
addresses.push_back(rr.dr.d_content->getZoneRepresentation()); // SOL if you have a CNAME for an NS
bool ok;
do {
DNSZoneRecord rr;
try {
ok = b->get(rr);
}
catch (PDNSException &ae) {
g_log << Logger::Error << "Skipping record: " << ae.reason << endl;
continue;
}
catch (std::exception &e) {
g_log << Logger::Error << "Skipping record: " << e.what() << endl;
continue;
}
if (ok) {
if (rr.dr.d_type == QType::A || rr.dr.d_type == QType::AAAA)
addresses.push_back(rr.dr.d_content->getZoneRepresentation()); // SOL if you have a CNAME for an NS
}
} while (ok);
}
return addresses;
}
Expand Down

0 comments on commit 475fc44

Please sign in to comment.