diff --git a/CHANGES b/CHANGES index 1d76a5b9b2..1de0e4bcb8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +4790. [bug] nsupdate could trigger a require when sending a + update to the second address of the server. + [RT #45731] + 4789. [cleanup] Check writability of new-zones-directory. [RT #46308] 4788. [cleanup] When using "update-policy local", log a warning diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c index fbe77e0a11..c922cf9765 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -150,6 +150,7 @@ static dns_dispatch_t *dispatchv4 = NULL; static dns_dispatch_t *dispatchv6 = NULL; static dns_message_t *updatemsg = NULL; static dns_fixedname_t fuserzone; +static dns_fixedname_t fzname; static dns_name_t *userzone = NULL; static dns_name_t *zname = NULL; static dns_name_t tmpzonename; @@ -2390,7 +2391,6 @@ update_completed(isc_task_t *task, isc_event_t *event) { dns_request_destroy(&request); dns_message_renderreset(updatemsg); dns_message_settsigkey(updatemsg, NULL); - /* XXX MPA fix zonename is freed already */ send_update(zname, &master_servers[master_inuse]); isc_event_free(&event); return; @@ -2693,13 +2693,17 @@ recvsoa(isc_task_t *task, isc_event_t *event) { dns_name_init(&master, NULL); dns_name_clone(&soa.origin, &master); - /* - * XXXMPA - */ - if (userzone != NULL) + if (userzone != NULL) { zname = userzone; - else - zname = name; + } else { + /* + * Save the zone name in case we need to try a second + * address. + */ + dns_fixedname_init(&fzname); + zname = dns_fixedname_name(&fzname); + dns_name_copy(name, zname, NULL); + } if (debugging) { char namestr[DNS_NAME_FORMATSIZE];