From c6a207c710e3552279a66d5085e68c33183ec8db Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 30 Nov 2023 11:18:41 +1100 Subject: [PATCH] Don't send NOTIFY over disabled address families (cherry picked from commit 5d9962551547e13274ff7d7f5af9abf4f4982341) --- lib/dns/zone.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index baaf67eb86..d5aff4f588 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -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);