diff --git a/CHANGES b/CHANGES index ecaec7850e..830f9af262 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ + 537. [func] Use transfer-source{-v6} when notify messages. + 536. [func] Use transfer-source{-v6} when sending refresh queries. Transfer-source{-v6} now take a optional port parameter for setting the UDP source port. The port diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index e9e2fea655..a167e15724 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zoneconf.c,v 1.63 2000/10/17 07:22:35 marka Exp $ */ +/* $Id: zoneconf.c,v 1.64 2000/10/31 05:34:18 marka Exp $ */ #include @@ -360,6 +360,24 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview, dns_zone_setsigvalidityinterval(zone, uintval); } + result = dns_c_zone_gettransfersource(czone, &sockaddr); + if (result != ISC_R_SUCCESS && cview != NULL) + result = dns_c_view_gettransfersource(cview, &sockaddr); + if (result != ISC_R_SUCCESS) + result = dns_c_ctx_gettransfersource(cctx, &sockaddr); + if (result != ISC_R_SUCCESS) + sockaddr = sockaddr_any4; + dns_zone_setxfrsource4(zone, &sockaddr); + + result = dns_c_zone_gettransfersourcev6(czone, &sockaddr); + if (result != ISC_R_SUCCESS && cview != NULL) + result = dns_c_view_gettransfersourcev6(cview, &sockaddr); + if (result != ISC_R_SUCCESS) + result = dns_c_ctx_gettransfersourcev6(cctx, &sockaddr); + if (result != ISC_R_SUCCESS) + sockaddr = sockaddr_any6; + dns_zone_setxfrsource6(zone, &sockaddr); + /* * Configure slave functionality. */ @@ -398,27 +416,6 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview, uintval = DNS_DEFAULT_IDLEIN; dns_zone_setidlein(zone, uintval); - result = dns_c_zone_gettransfersource(czone, &sockaddr); - if (result != ISC_R_SUCCESS && cview != NULL) - result = dns_c_view_gettransfersource(cview, - &sockaddr); - if (result != ISC_R_SUCCESS) - result = dns_c_ctx_gettransfersource(cctx, &sockaddr); - if (result != ISC_R_SUCCESS) - sockaddr = sockaddr_any4; - dns_zone_setxfrsource4(zone, &sockaddr); - - result = dns_c_zone_gettransfersourcev6(czone, &sockaddr); - if (result != ISC_R_SUCCESS && cview != NULL) - result = dns_c_view_gettransfersourcev6(cview, - &sockaddr); - if (result != ISC_R_SUCCESS) - result = dns_c_ctx_gettransfersourcev6(cctx, - &sockaddr); - if (result != ISC_R_SUCCESS) - sockaddr = sockaddr_any6; - dns_zone_setxfrsource6(zone, &sockaddr); - result = dns_c_zone_getmaxrefreshtime(czone, &uintval); if (result != ISC_R_SUCCESS && cview != NULL) result = dns_c_view_getmaxrefreshtime(cview, &uintval); diff --git a/bin/tests/system/notify/ns1/named.conf b/bin/tests/system/notify/ns1/named.conf index 9632683afb..cd4ffb30cd 100644 --- a/bin/tests/system/notify/ns1/named.conf +++ b/bin/tests/system/notify/ns1/named.conf @@ -15,10 +15,11 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named.conf,v 1.10 2000/09/01 19:27:19 gson Exp $ */ +/* $Id: named.conf,v 1.11 2000/10/31 05:34:07 marka Exp $ */ options { query-source address 10.53.0.1; + transfer-source 10.53.0.1; port 5300; pid-file "named.pid"; listen-on { 10.53.0.1; }; diff --git a/bin/tests/system/notify/ns2/named.conf b/bin/tests/system/notify/ns2/named.conf index ecb54023ef..b548c9bcef 100644 --- a/bin/tests/system/notify/ns2/named.conf +++ b/bin/tests/system/notify/ns2/named.conf @@ -15,10 +15,11 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named.conf,v 1.11 2000/08/01 01:16:05 tale Exp $ */ +/* $Id: named.conf,v 1.12 2000/10/31 05:34:08 marka Exp $ */ options { query-source address 10.53.0.2; + transfer-source 10.53.0.2; port 5300; pid-file "named.pid"; listen-on { 10.53.0.2; }; diff --git a/bin/tests/system/notify/ns3/named.conf b/bin/tests/system/notify/ns3/named.conf index b167df8a7a..d46902f74f 100644 --- a/bin/tests/system/notify/ns3/named.conf +++ b/bin/tests/system/notify/ns3/named.conf @@ -15,10 +15,11 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named.conf,v 1.13 2000/09/01 19:27:20 gson Exp $ */ +/* $Id: named.conf,v 1.14 2000/10/31 05:34:10 marka Exp $ */ options { query-source address 10.53.0.3; + transfer-source 10.53.0.3; port 5300; pid-file "named.pid"; listen-on { 10.53.0.3; }; diff --git a/bin/tests/system/xferquota/ns1/named.conf b/bin/tests/system/xferquota/ns1/named.conf index c71c4d443a..feb5cf85e8 100644 --- a/bin/tests/system/xferquota/ns1/named.conf +++ b/bin/tests/system/xferquota/ns1/named.conf @@ -15,10 +15,11 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named.conf,v 1.13 2000/09/01 19:29:50 gson Exp $ */ +/* $Id: named.conf,v 1.14 2000/10/31 05:34:11 marka Exp $ */ options { query-source address 10.53.0.1; + transfer-source 10.53.0.1; port 5300; pid-file "named.pid"; listen-on { 10.53.0.1; }; diff --git a/bin/tests/system/xferquota/ns2/named.conf b/bin/tests/system/xferquota/ns2/named.conf index 0b3685ada9..6fa2222a67 100644 --- a/bin/tests/system/xferquota/ns2/named.conf +++ b/bin/tests/system/xferquota/ns2/named.conf @@ -15,10 +15,11 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named.conf,v 1.10 2000/08/01 01:17:30 tale Exp $ */ +/* $Id: named.conf,v 1.11 2000/10/31 05:34:12 marka Exp $ */ options { query-source address 10.53.0.2; + transfer-source 10.53.0.2; port 5300; pid-file "named.pid"; listen-on { 10.53.0.2; }; diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml index 361751c527..ee8bae9f04 100644 --- a/doc/arm/Bv9ARM-book.xml +++ b/doc/arm/Bv9ARM-book.xml @@ -2,7 +2,7 @@ - + @@ -2968,9 +2968,8 @@ of the server statement. transfer-source determines which local address will be bound to IPv4 TCP connections used to fetch zones transferred inbound by the server. It also determines -the IPv4 address, and optionaly the UDP port, used for the refresh queries. -It also determines the IPv4 address used when updates are forwarded. -If not set, it defaults +the IPv4 address, and optionaly the UDP port, used for the refresh queries, +notify messages and when updates are forwarded. If not set, it defaults to a system controlled value which will usually be the address of the interface "closest to" the remote end. This address must appear in the remote end's allow-transfer option for @@ -3749,8 +3748,8 @@ on loading and ignores the option. transfer-source Determines which local address will be bound to the IPv4 TCP connection used to fetch this zone. It also determines -the IPv4 address, and optionaly the UDP port, used for the refresh queries. -It also determines the IPv4 address used when updates are forwarded. If not set, +the IPv4 address, and optionaly the UDP port, used for the refresh queries, +notify messages and when updates are forwarded. If not set, it defaults to a system controlled value which will usually be the address of the interface "closest to" the remote end. If the remote end user is an allow-transfer option for this diff --git a/doc/misc/migration b/doc/misc/migration index 45a1fc7657..f529c7af5a 100644 --- a/doc/misc/migration +++ b/doc/misc/migration @@ -56,6 +56,10 @@ immediately after the "logging" statement was read. In BIND 9, ACL names are case sensitive. In BIND 8 they were case insensitive. +1.5. Notify messages and Refesh queries + +The source address and port for these is now controlled by +transfer-source rather that query-source. 2. Zone File Compatibility @@ -155,4 +159,4 @@ see the man pages in doc/man/bin/rndc.1 and doc/man/bin/rndc.conf.5 for details. Many of the ndc commands are still unimplemented in rndc. -$Id: migration,v 1.14 2000/09/18 23:41:20 gson Exp $ +$Id: migration,v 1.15 2000/10/31 05:34:15 marka Exp $ diff --git a/lib/dns/zone.c b/lib/dns/zone.c index da514b65e6..37436cc90d 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.243 2000/10/31 03:22:04 marka Exp $ */ +/* $Id: zone.c,v 1.244 2000/10/31 05:34:17 marka Exp $ */ #include @@ -2241,6 +2241,7 @@ notify_send_toaddr(isc_task_t *task, isc_event_t *event) { isc_netaddr_t dstip; dns_tsigkey_t *key = NULL; char addrbuf[ISC_SOCKADDR_FORMATSIZE]; + isc_sockaddr_t src; notify = event->ev_arg; REQUIRE(DNS_NOTIFY_VALID(notify)); @@ -2272,11 +2273,27 @@ notify_send_toaddr(isc_task_t *task, isc_event_t *event) { isc_sockaddr_format(¬ify->dst, addrbuf, sizeof(addrbuf)); notify_log(notify->zone, ISC_LOG_INFO, "sending NOTIFY to %s", addrbuf); - result = dns_request_create(notify->zone->view->requestmgr, message, - ¬ify->dst, 0, key, 15, - notify->zone->task, - notify_done, notify, - ¬ify->request); + switch (isc_sockaddr_pf(¬ify->dst)) { + case PF_INET: + src = notify->zone->xfrsource4; + break; + case PF_INET6: + src = notify->zone->xfrsource6; + break; + default: + result = ISC_R_NOTIMPLEMENTED; + goto cleanup; + } + { + char buf[256]; + isc_sockaddr_format(&src, buf, sizeof(buf)); + fprintf(stderr, "notify via %s\n", buf); + } + result = dns_request_createvia(notify->zone->view->requestmgr, message, + &src, ¬ify->dst, 0, key, 15, + notify->zone->task, + notify_done, notify, + ¬ify->request); if (key != NULL) dns_tsigkey_detach(&key); dns_message_destroy(&message); diff --git a/lib/dns/zoneconf.c b/lib/dns/zoneconf.c index e9e2fea655..a167e15724 100644 --- a/lib/dns/zoneconf.c +++ b/lib/dns/zoneconf.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zoneconf.c,v 1.63 2000/10/17 07:22:35 marka Exp $ */ +/* $Id: zoneconf.c,v 1.64 2000/10/31 05:34:18 marka Exp $ */ #include @@ -360,6 +360,24 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview, dns_zone_setsigvalidityinterval(zone, uintval); } + result = dns_c_zone_gettransfersource(czone, &sockaddr); + if (result != ISC_R_SUCCESS && cview != NULL) + result = dns_c_view_gettransfersource(cview, &sockaddr); + if (result != ISC_R_SUCCESS) + result = dns_c_ctx_gettransfersource(cctx, &sockaddr); + if (result != ISC_R_SUCCESS) + sockaddr = sockaddr_any4; + dns_zone_setxfrsource4(zone, &sockaddr); + + result = dns_c_zone_gettransfersourcev6(czone, &sockaddr); + if (result != ISC_R_SUCCESS && cview != NULL) + result = dns_c_view_gettransfersourcev6(cview, &sockaddr); + if (result != ISC_R_SUCCESS) + result = dns_c_ctx_gettransfersourcev6(cctx, &sockaddr); + if (result != ISC_R_SUCCESS) + sockaddr = sockaddr_any6; + dns_zone_setxfrsource6(zone, &sockaddr); + /* * Configure slave functionality. */ @@ -398,27 +416,6 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview, uintval = DNS_DEFAULT_IDLEIN; dns_zone_setidlein(zone, uintval); - result = dns_c_zone_gettransfersource(czone, &sockaddr); - if (result != ISC_R_SUCCESS && cview != NULL) - result = dns_c_view_gettransfersource(cview, - &sockaddr); - if (result != ISC_R_SUCCESS) - result = dns_c_ctx_gettransfersource(cctx, &sockaddr); - if (result != ISC_R_SUCCESS) - sockaddr = sockaddr_any4; - dns_zone_setxfrsource4(zone, &sockaddr); - - result = dns_c_zone_gettransfersourcev6(czone, &sockaddr); - if (result != ISC_R_SUCCESS && cview != NULL) - result = dns_c_view_gettransfersourcev6(cview, - &sockaddr); - if (result != ISC_R_SUCCESS) - result = dns_c_ctx_gettransfersourcev6(cctx, - &sockaddr); - if (result != ISC_R_SUCCESS) - sockaddr = sockaddr_any6; - dns_zone_setxfrsource6(zone, &sockaddr); - result = dns_c_zone_getmaxrefreshtime(czone, &uintval); if (result != ISC_R_SUCCESS && cview != NULL) result = dns_c_view_getmaxrefreshtime(cview, &uintval);