Changeset 1085
- Timestamp:
- 08/16/07 23:42:50 (1 year ago)
- Files:
-
- trunk/pdns/pdns/common_startup.cc (modified) (1 diff)
- trunk/pdns/pdns/communicator.cc (modified) (1 diff)
- trunk/pdns/pdns/nproxy.cc (modified) (1 diff)
- trunk/pdns/pdns/packethandler.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pdns/pdns/common_startup.cc
r944 r1085 110 110 arg().set("soa-expire-default","Default SOA expire")="604800"; 111 111 112 arg().set("trusted-notification-proxy", "IP address of incoming notification proxy")=""; 113 112 114 arg().set("default-ttl","Seconds a result is valid if not set otherwise")="3600"; 113 115 arg().set("max-tcp-connections","Maximum number of TCP connections")="10"; trunk/pdns/pdns/communicator.cc
r1048 r1085 106 106 } 107 107 catch(ResolverException &re) { 108 L<<Logger::Error<<"Unable to AXFR zone '"+domain+"' : "<<re.reason<<endl;108 L<<Logger::Error<<"Unable to AXFR zone '"+domain+"' from remote '"<<remote<<"': "<<re.reason<<endl; 109 109 if(di.backend && !first) { 110 110 L<<Logger::Error<<"Aborting possible open transaction for domain '"<<domain<<"' AXFR"<<endl; trunk/pdns/pdns/nproxy.cc
r1083 r1085 227 227 throw runtime_error("Failed to connect PowerDNS socket to address "+pdns.toStringWithPort()+": "+stringerror()); 228 228 229 syslogFmt(boost::format("Sending notifications to internal address %s") % pdns.toStringWithPort());229 syslogFmt(boost::format("Sending notifications from %s to internal address %s") % originAddress.toString() % pdns.toStringWithPort()); 230 230 231 231 g_fdm.addReadFD(g_pdnssocket, handleInsideUDPPacket); trunk/pdns/pdns/packethandler.cc
r1081 r1085 489 489 DNSBackend *db=0; 490 490 DomainInfo di; 491 di.serial = 0; 491 492 if(!B.getDomainInfo(p->qdomain, di) || !(db=di.backend)) { 492 493 L<<Logger::Error<<"Received NOTIFY for "<<p->qdomain<<" from "<<p->getRemote()<<" for which we are not authoritative"<<endl; … … 494 495 } 495 496 496 if(!db->isMaster(p->qdomain, p->getRemote())) { 497 string authServer(p->getRemote()); 498 if(p->getRemote() == arg()["trusted-notification-proxy"]) { 499 L<<Logger::Error<<"Received NOTIFY for "<<p->qdomain<<" from trusted-notification-proxy "<< p->getRemote()<<endl; 500 if(di.masters.empty()) { 501 L<<Logger::Error<<"However, "<<p->qdomain<<" does not have any masters defined"<<endl; 502 return RCode::Refused; 503 } 504 505 authServer = *di.masters.begin(); 506 507 } 508 else if(!db->isMaster(p->qdomain, p->getRemote())) { 497 509 L<<Logger::Error<<"Received NOTIFY for "<<p->qdomain<<" from "<<p->getRemote()<<" which is not a master"<<endl; 498 510 return RCode::Refused; … … 506 518 Resolver resolver; 507 519 try { 508 resolver.getSoaSerial( p->getRemote(),p->qdomain, &theirserial);520 resolver.getSoaSerial(authServer, p->qdomain, &theirserial); 509 521 } 510 522 catch(ResolverException& re) { … … 512 524 return RCode::ServFail; 513 525 } 514 515 526 516 527 if(theirserial<=di.serial) { 517 L<<Logger::Error<<"Received NOTIFY for "<<p->qdomain<<" from master "<<p->getRemote()<<", we are up to date: "<<528 L<<Logger::Error<<"Received NOTIFY for "<<p->qdomain<<" from "<< authServer <<", we are up to date: "<< 518 529 theirserial<<"<="<<di.serial<<endl; 519 530 return RCode::NoError; … … 523 534 theirserial<<" > "<<di.serial<<endl; 524 535 525 Communicator.addSuckRequest(p->qdomain, p->getRemote(),true); // priority536 Communicator.addSuckRequest(p->qdomain, authServer, true); // priority 526 537 } 527 538 return -1; … … 911 922 } 912 923 catch(exception &e) { 913 L<<Logger::Error<<"Exception building ans er packet ("<<e.what()<<") sending out servfail"<<endl;924 L<<Logger::Error<<"Exception building answer packet ("<<e.what()<<") sending out servfail"<<endl; 914 925 delete r; 915 926 r=p->replyPacket(); // generate an empty reply packet