]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Don't retry +tcp queries on failure if tries=1 or retries=0
authorDiego Fronza <diego@isc.org>
Mon, 15 Feb 2021 22:28:50 +0000 (19:28 -0300)
committerDiego Fronza <diego@isc.org>
Thu, 25 Mar 2021 17:08:39 +0000 (14:08 -0300)
Before this commit, a premature EOF (connection closed) on tcp queries
was causing dig to automatically attempt to send the query again, even
if +tries=1 or +retries=0 was provided on command line.

This commit fix the problem by taking into account the no. of retries
specified by the user when processing a premature EOF on tcp
connections.

bin/dig/dighost.c

index 178c241708faaa8e46f42e4813c173c9b50e16ed..9d8a1e5a2232967a4b5b7c749bde2b091ee6043b 100644 (file)
@@ -3117,7 +3117,8 @@ force_next(dig_query_t *query) {
  */
 static void
 requeue_or_update_exitcode(dig_lookup_t *lookup) {
-       if (lookup->eoferr == 0U) {
+       if (lookup->eoferr == 0U && lookup->retries > 1) {
+               --lookup->retries;
                /*
                 * Peer closed the connection prematurely for the first time
                 * for this lookup.  Try again, keeping track of this failure.