]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Handle address lookup failure more gracefully
authorMark Andrews <marka@isc.org>
Mon, 30 Jan 2023 00:18:49 +0000 (11:18 +1100)
committerMark Andrews <marka@isc.org>
Tue, 31 Jan 2023 12:51:44 +0000 (23:51 +1100)
If the address lookup of the primary server fails just abort
the current update request rather than calling exit.  This allows
nsupdate to cleanup gracefully.

bin/nsupdate/nsupdate.c

index a67a651db6220c6f85f34569fc2e4a68a6234715..49ee0e3b0851718b58fd09b1d69869bcc60c2bc4 100644 (file)
@@ -2797,8 +2797,8 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
                dns_request_destroy(&request);
                dns_message_detach(&soaquery);
                ddebug("Out of recvsoa");
-               done_update();
                seenerror = true;
+               done_update();
                return;
        }
 
@@ -2903,7 +2903,14 @@ lookforsoa:
                primary_total = get_addresses(serverstr, dnsport,
                                              primary_servers, primary_alloc);
                if (primary_total == 0) {
-                       exit(1);
+                       seenerror = true;
+                       dns_rdata_freestruct(&soa);
+                       dns_message_detach(&soaquery);
+                       dns_request_destroy(&request);
+                       dns_message_detach(&rcvmsg);
+                       ddebug("Out of recvsoa");
+                       done_update();
+                       return;
                }
                primary_inuse = 0;
        } else {