From bd6504aa9aa16a912412fbe010046aaf4bf23621 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Wed, 11 Jul 2001 06:30:54 +0000 Subject: [PATCH] 928. [bug] nsupdate would send empty update packets if the send (or empty line) command was run after another send but before any new updates or prerequisites were specified. It should simply ignore this command. --- CHANGES | 7 +++++++ bin/nsupdate/nsupdate.c | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 1076df9757..9a466d0031 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ + + 928. [bug] nsupdate would send empty update packets if the + send (or empty line) command was run after + another send but before any new updates or + prerequisites were specified. It should simply + ignore this command. + 927. [bug] Don't hold the zone lock for the entire dump to disk. [RT #1423] diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c index 7a81129bf0..705c08c100 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nsupdate.c,v 1.96 2001/07/02 18:56:58 gson Exp $ */ +/* $Id: nsupdate.c,v 1.97 2001/07/11 06:30:54 bwelling Exp $ */ #include @@ -1753,17 +1753,23 @@ start_update(void) { ddebug("start_update()"); - if (userzone != NULL && userserver != NULL) { - send_update(userzone, userserver, localaddr); - return; - } - result = dns_message_firstname(updatemsg, DNS_SECTION_UPDATE); if (result != ISC_R_SUCCESS) { done_update(); return; } + result = dns_message_firstname(updatemsg, DNS_SECTION_PREREQUISITE); + if (result != ISC_R_SUCCESS) { + done_update(); + return; + } + + if (userzone != NULL && userserver != NULL) { + send_update(userzone, userserver, localaddr); + return; + } + result = dns_message_create(mctx, DNS_MESSAGE_INTENTRENDER, &soaquery); check_result(result, "dns_message_create");