From: Mark Andrews Date: Mon, 30 Jan 2023 00:18:49 +0000 (+1100) Subject: Handle address lookup failure more gracefully X-Git-Tag: v9.19.10~6^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f1387514c68c338fe35ed4bfaa73ec06136a9f92;p=thirdparty%2Fbind9.git Handle address lookup failure more gracefully 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. --- diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c index a67a651db62..49ee0e3b085 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -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 {