From 40fd4cd407fd2a215d754153c21baaaa3a523f7b Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 4 Apr 2024 10:35:23 +1100 Subject: [PATCH 1/3] Wrong source address used for IPv6 notify messages The source address field of 'newnotify' was not updated from the default (0.0.0.0) when the destination address was an IPv6 address. This resulted in the messages failing to be sent. Set the source address to :: when the destination address is an IPv6 address. --- lib/dns/zone.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index d70155bf74..cf09283221 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -12535,6 +12535,9 @@ notify_send(dns_notify_t *notify) { zone_iattach(notify->zone, &newnotify->zone); ISC_LIST_APPEND(newnotify->zone->notifies, newnotify, link); newnotify->dst = dst; + if (isc_sockaddr_pf(&dst) == AF_INET6) { + isc_sockaddr_any6(&newnotify->src); + } startup = ((notify->flags & DNS_NOTIFY_STARTUP) != 0); result = notify_send_queue(newnotify, startup); if (result != ISC_R_SUCCESS) { From 7c369ea3d9e5b10086859873446eae320fabdd16 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 4 Apr 2024 11:24:59 +1100 Subject: [PATCH 2/3] Check that notify message was sent over IPv6 --- bin/tests/system/notify/ns2/example2.db | 1 + bin/tests/system/notify/ns2/named.conf.in | 1 + bin/tests/system/notify/ns3/named.conf.in | 2 +- bin/tests/system/notify/tests.sh | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/tests/system/notify/ns2/example2.db b/bin/tests/system/notify/ns2/example2.db index c762dd611d..bc884262c8 100644 --- a/bin/tests/system/notify/ns2/example2.db +++ b/bin/tests/system/notify/ns2/example2.db @@ -22,6 +22,7 @@ example. NS ns2.example. ns2.example. A 10.53.0.2 example. NS ns3.example. ns3.example. A 10.53.0.3 +ns3.example. AAAA fd92:7065:b8e:ffff::3 $ORIGIN example. a A 10.0.0.2 diff --git a/bin/tests/system/notify/ns2/named.conf.in b/bin/tests/system/notify/ns2/named.conf.in index 203f23ca6e..3f16e229db 100644 --- a/bin/tests/system/notify/ns2/named.conf.in +++ b/bin/tests/system/notify/ns2/named.conf.in @@ -14,6 +14,7 @@ options { query-source address 10.53.0.2; notify-source 10.53.0.2; + notify-source-v6 fd92:7065:b8e:ffff::2; transfer-source 10.53.0.2; port @PORT@; pid-file "named.pid"; diff --git a/bin/tests/system/notify/ns3/named.conf.in b/bin/tests/system/notify/ns3/named.conf.in index 4761622651..73338a4a30 100644 --- a/bin/tests/system/notify/ns3/named.conf.in +++ b/bin/tests/system/notify/ns3/named.conf.in @@ -18,7 +18,7 @@ options { port @PORT@; pid-file "named.pid"; listen-on { 10.53.0.3; }; - listen-on-v6 { none; }; + listen-on-v6 { fd92:7065:b8e:ffff::3; }; recursion yes; notify yes; dnssec-validation no; diff --git a/bin/tests/system/notify/tests.sh b/bin/tests/system/notify/tests.sh index 788947a6c0..d929add54c 100644 --- a/bin/tests/system/notify/tests.sh +++ b/bin/tests/system/notify/tests.sh @@ -109,6 +109,7 @@ wait_for_log_re 45 "transfer of 'example/IN' from 10.53.0.2#.*success" ns3/named test_start "checking notify message was logged" grep 'notify from 10.53.0.2#[0-9][0-9]*: serial 2$' ns3/named.run >/dev/null || ret=1 +grep 'refused notify from non-primary: fd92:7065:b8e:ffff::2#[0-9][0-9]*$' ns3/named.run >/dev/null || ret=1 test_end test_start "checking example2 loaded" From 9cc6b4a68a9a774cd8817e96864898693b0d51f3 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 4 Apr 2024 10:43:29 +1100 Subject: [PATCH 3/3] Add CHANGES note for [GL #4669] --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index d77f8fe866..601118ebe7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +6370. [bug] Wrong source address used for IPv6 notify messages. + [GL #4669] + 6369. [func] The 'fixed' value for the 'rrset-order' option has been marked and documented as deprecated. [GL #4446]