From deb3b85cb2faba8fd72172a8df0e0631033196aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Fri, 24 Aug 2018 13:49:45 +0200 Subject: [PATCH 1/2] 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. --- bin/dig/dighost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 98e3595bb4..2903bb020c 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); From 59057bee5b1b8ad65f21fc241164663f051e23ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Fri, 24 Aug 2018 13:49:45 +0200 Subject: [PATCH 2/2] Add CHANGES entry 5020. [bug] dig returned a non-zero exit code when it received a reply over TCP after a retry. [GL #487] --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 03bafd02bf..9cf760c979 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5021. [bug] dig returned a non-zero exit code when it received a + reply over TCP after a retry. [GL #487] + 5020. [func] RNG uses thread-local storage instead of locks, if supported by platform. [GL #496]