]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Don't retry notify over TCP if it could not successed
authorOndřej Surý <ondrej@isc.org>
Thu, 19 Feb 2026 12:44:28 +0000 (13:44 +0100)
committerOndřej Surý <ondrej@isc.org>
Fri, 20 Feb 2026 09:50:19 +0000 (10:50 +0100)
Prevent retrying the notify over TCP in case the source address is not
available or the source vs the destination address family mismatch or
when the destination address has been blackholed.  Properly log the
hard notify failures.

(cherry picked from commit 5a5bc6de223afc867f22d19bd9666eaf39e2b877)

lib/dns/zone.c

index bf70dcdce87d1e388d0ca2f0456f29b9792c4220..2079168fe3806b0f76940525aacd9d23e1663b6e 100644 (file)
@@ -12747,7 +12747,8 @@ again:
 
        isc_tlsctx_cache_detach(&zmgr_tlsctx_cache);
 
-       if (result == ISC_R_SUCCESS) {
+       switch (result) {
+       case ISC_R_SUCCESS:
                if (isc_sockaddr_pf(&notify->dst) == AF_INET) {
                        inc_stats(notify->zone,
                                  dns_zonestatscounter_notifyoutv4);
@@ -12755,14 +12756,24 @@ again:
                        inc_stats(notify->zone,
                                  dns_zonestatscounter_notifyoutv6);
                }
-       } else if (result == ISC_R_SHUTTINGDOWN || result == ISC_R_CANCELED) {
-               goto cleanup_key;
-       } else if ((notify->flags & DNS_NOTIFY_TCP) == 0) {
+               break;
+       case ISC_R_SHUTTINGDOWN:
+       case ISC_R_CANCELED:
+       case ISC_R_ADDRNOTAVAIL:
+       case DNS_R_BLACKHOLED:
+       case ISC_R_FAMILYNOSUPPORT:
                notify_log(notify->zone, ISC_LOG_NOTICE,
-                          "notify to %s failed: %s: retrying over TCP",
-                          addrbuf, isc_result_totext(result));
-               notify->flags |= DNS_NOTIFY_TCP;
-               goto again;
+                          "notify to %s failed: %s", addrbuf,
+                          isc_result_totext(result));
+               break;
+       default:
+               if ((notify->flags & DNS_NOTIFY_TCP) == 0) {
+                       notify_log(notify->zone, ISC_LOG_NOTICE,
+                                  "notify to %s failed: %s: retrying over TCP",
+                                  addrbuf, isc_result_totext(result));
+                       notify->flags |= DNS_NOTIFY_TCP;
+                       goto again;
+               }
        }
 
 cleanup_key: