pthread_create(&tid, 0, &retrieveLaunchhelper, this); // Starts CommunicatorClass::retrievalLoopThread()
d_preventSelfNotification = ::arg().mustDo("prevent-self-notification");
- d_onlyNotify.toMasks(::arg()["only-notify"]);
+
+ try {
+ d_onlyNotify.toMasks(::arg()["only-notify"]);
+ }
+ catch(PDNSException &e) {
+ L<<Logger::Error<<"Unparseable IP in only-notify. Error: "<<e.reason<<endl;
+ exit(0);
+ }
vector<string> parts;
stringtok(parts, ::arg()["also-notify"], ", \t");
- for (vector<string>::const_iterator iter = parts.begin(); iter != parts.end(); ++iter)
- d_alsoNotify.insert(*iter);
+ for (vector<string>::const_iterator iter = parts.begin(); iter != parts.end(); ++iter) {
+ try {
+ ComboAddress caIp(*iter, 53);
+ d_alsoNotify.insert(caIp.toStringWithPort());
+ }
+ catch(PDNSException &e) {
+ L<<Logger::Error<<"Unparseable IP in also-notify. Error: "<<e.reason<<endl;
+ exit(0);
+ }
+ }
}
void CommunicatorClass::mainloop(void)
B->alsoNotifies(domain, &alsoNotify);
for(set<string>::const_iterator j=alsoNotify.begin();j!=alsoNotify.end();++j) {
- const ComboAddress caIp(*j, 53);
- L<<Logger::Warning<<"Queued also-notification of domain '"<<domain<<"' to "<<caIp.toStringWithPort()<<endl;
- if (!ips.count(caIp.toStringWithPort())) {
- ips.insert(caIp.toStringWithPort());
- d_nq.add(domain, caIp.toStringWithPort());
+ try {
+ const ComboAddress caIp(*j, 53);
+ L<<Logger::Warning<<"Queued also-notification of domain '"<<domain<<"' to "<<caIp.toStringWithPort()<<endl;
+ if (!ips.count(caIp.toStringWithPort())) {
+ ips.insert(caIp.toStringWithPort());
+ d_nq.add(domain, caIp.toStringWithPort());
+ }
+ hasQueuedItem=true;
+ }
+ catch(PDNSException &e) {
+ L<<Logger::Warning<<"Unparseable IP in ALSO-NOTIFY metadata of domain '"<<domain<<"'. Warning: "<<e.reason<<endl;
}
- hasQueuedItem=true;
}
if (!hasQueuedItem)
- L<<Logger::Warning<<"Request to queue notification for domain '"<<domain<<"' was processed, but no nameservers or ALSO-NOTIFYs found. Not notifying!"<<endl;
+ L<<Logger::Warning<<"Request to queue notification for domain '"<<domain<<"' was processed, but no valid nameservers or ALSO-NOTIFYs found. Not notifying!"<<endl;
}