From: Michał Kępień Date: Fri, 24 Aug 2018 11:49:45 +0000 (+0200) Subject: Reset dig exit code after a TCP connection is established X-Git-Tag: v9.13.3~36^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deb3b85cb2faba8fd72172a8df0e0631033196aa;p=thirdparty%2Fbind9.git Reset dig exit code after a TCP connection is established The "exitcode" variable is set to 9 if a TCP connection fails, but is not reset to 0 if a subsequent TCP connection succeeds. This causes dig to return a non-zero exit code if it succeeds in getting a TCP response after a retry. Fix by resetting "exitcode" to 0 if connect_done() receives an event with the "result" field set to ISC_R_SUCCESS. --- diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 98e3595bb4f..2903bb020c0 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -3202,6 +3202,7 @@ connect_done(isc_task_t *task, isc_event_t *event) { UNLOCK_LOOKUP; return; } + exitcode = 0; if (keep_open) { if (keep != NULL) isc_socket_detach(&keep);