]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Don't send NOTIFY over disabled address families
authorMark Andrews <marka@isc.org>
Thu, 30 Nov 2023 00:18:41 +0000 (11:18 +1100)
committerMark Andrews <marka@isc.org>
Mon, 3 Jun 2024 13:52:37 +0000 (13:52 +0000)
(cherry picked from commit 5d9962551547e13274ff7d7f5af9abf4f4982341)

lib/dns/zone.c

index baaf67eb867a62bf86ba6995dceb45deadbe7c59..d5aff4f5885ed9e7375cac368df3696de3f280e2 100644 (file)
@@ -12496,8 +12496,14 @@ notify_find_address(dns_notify_t *notify) {
        unsigned int options;
 
        REQUIRE(DNS_NOTIFY_VALID(notify));
-       options = DNS_ADBFIND_WANTEVENT | DNS_ADBFIND_INET | DNS_ADBFIND_INET6 |
-                 DNS_ADBFIND_RETURNLAME;
+
+       options = DNS_ADBFIND_WANTEVENT | DNS_ADBFIND_RETURNLAME;
+       if (isc_net_probeipv4() != ISC_R_DISABLED) {
+               options |= DNS_ADBFIND_INET;
+       }
+       if (isc_net_probeipv6() != ISC_R_DISABLED) {
+               options |= DNS_ADBFIND_INET6;
+       }
 
        if (notify->zone->view->adb == NULL) {
                goto destroy;
@@ -12902,6 +12908,17 @@ zone_notify(dns_zone_t *zone, isc_time_t *now) {
                /* TODO: glue the transport to the notify */
 
                dst = zone->notify[i];
+
+               if (isc_sockaddr_disabled(&dst)) {
+                       if (key != NULL) {
+                               dns_tsigkey_detach(&key);
+                       }
+                       if (transport != NULL) {
+                               dns_transport_detach(&transport);
+                       }
+                       continue;
+               }
+
                if (notify_isqueued(zone, flags, NULL, &dst, key, transport)) {
                        if (key != NULL) {
                                dns_tsigkey_detach(&key);