]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: Remove usage of parseService[4|6] and ServiceTuple 11989/head
authorFred Morcos <fred.morcos@open-xchange.com>
Thu, 22 Sep 2022 15:22:52 +0000 (17:22 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Mon, 26 Sep 2022 08:43:04 +0000 (10:43 +0200)
pdns/communicator.hh
pdns/mastercommunicator.cc

index 4ad92171820ae77c112dfb42593d2d2a7647347d..b4e90f3bcbc3fc757f016bfa2a42a1060cf81477 100644 (file)
@@ -84,12 +84,9 @@ public:
 
   bool removeIf(const ComboAddress& remote, uint16_t id, const DNSName& domain)
   {
-    ServiceTuple stRemote, stQueued;
-    parseService(remote, stRemote);
-
     for (auto i = d_nqueue.begin(); i != d_nqueue.end(); ++i) {
-      parseService(i->ip, stQueued);
-      if (i->id == id && stQueued.host == stRemote.host && i->domain == domain) {
+      ComboAddress stQueued{i->ip};
+      if (i->id == id && stQueued == remote && i->domain == domain) {
         d_nqueue.erase(i);
         return true;
       }
index 7bbfd78d5f5048196bc2b0e6c26e90be305e7154..bb511fcbe46db00e5996f79b9b60c42651285c03 100644 (file)
@@ -240,7 +240,7 @@ time_t CommunicatorClass::doNotifications(PacketHandler* P)
       g_log << Logger::Warning << "Received unsuccessful notification report for '" << p.qdomain << "' from " << from.toStringWithPort() << ", error: " << RCode::to_s(p.d.rcode) << endl;
     }
 
-    if (d_nq.removeIf(from.toStringWithPort(), p.d.id, p.qdomain)) {
+    if (d_nq.removeIf(from, p.d.id, p.qdomain)) {
       g_log << Logger::Notice << "Removed from notification list: '" << p.qdomain << "' to " << from.toStringWithPort() << " " << (p.d.rcode ? RCode::to_s(p.d.rcode) : "(was acknowledged)") << endl;
     }
     else {
@@ -261,7 +261,7 @@ time_t CommunicatorClass::doNotifications(PacketHandler* P)
         ComboAddress remote(ip, 53); // default to 53
         if ((d_nsock6 < 0 && remote.sin4.sin_family == AF_INET6) || (d_nsock4 < 0 && remote.sin4.sin_family == AF_INET)) {
           g_log << Logger::Warning << "Unable to notify " << remote.toStringWithPort() << " for domain '" << domain << "', address family is disabled. Is an IPv" << (remote.sin4.sin_family == AF_INET ? "4" : "6") << " address set in query-local-address?" << endl;
-          d_nq.removeIf(remote.toStringWithPort(), id, domain); // Remove, we'll never be able to notify
+          d_nq.removeIf(remote, id, domain); // Remove, we'll never be able to notify
           continue; // don't try to notify what we can't!
         }
         if (d_preventSelfNotification && AddressIsUs(remote)) {