Author: Diane Bruce <db@db.net> (by way of Vampire- <vamposdecampos@gmail.com>)
authorAlex Badea <vamposdecampos@gmail.com>
Mon, 17 Oct 2005 17:37:00 +0000 (17:37 +0000)
committerAlex Badea <vamposdecampos@gmail.com>
Mon, 17 Oct 2005 17:37:00 +0000 (17:37 +0000)
Log message:

ircd_res.c would send out hundreds? of retry requests on clients that
did not resolve, i.e. SERVFAIL. The code was essentailly ignoring
SERVFAIL hence generating request after request after request.
This appears to fix this major bug.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1530 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/ircd_res.c

index 6bb6fa9503eabef421a3ad15a1c7232a84ebeda7..0b5c602b80d084a4625b98c51deb390bfa5662c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-17  Diane Bruce  <db@db.net>
+
+       * ircd/ircd_res.c: Don't send retries if the client did
+       not resolve (SERVFAIL); this fixes a bug causing a flurry
+       of retries in this case
+
 2005-10-14  Michael Poole <mdpoole@troilus.org>
 
        * include/patchlevel.h (PATCHLEVEL): Update to pre02.
index 0996822dda96294393126a619c0652d3ef05362f..6467abaa4e942b36407a7aac2e0244f7dd1410e9 100644 (file)
@@ -788,7 +788,15 @@ res_readreply(struct Event *ev)
   if ((header->rcode != NO_ERRORS) || (header->ancount == 0))
   {
     if (SERVFAIL == header->rcode)
-      resend_query(request);
+    {
+        /*
+         * If a bad error was returned, we stop here and don't send
+         * send any more (no retries granted).
+         */
+        Debug((DEBUG_DNS, "Request %p has bad response (state %d type %d rcode %d)", request, request->state, request->type, header->rcode));
+        (*request->callback)(request->callback_ctx, NULL, NULL);
+       rem_request(request);
+    }
     else
     {
       /*
@@ -808,16 +816,6 @@ res_readreply(struct Event *ev)
         request->timeout += feature_int(FEAT_IRCD_RES_TIMEOUT);
         resend_query(request);
       }
-      else
-      {
-        /*
-         * If a bad error was returned, we stop here and don't send
-         * send any more (no retries granted).
-         */
-        Debug((DEBUG_DNS, "Request %p has bad response (state %d type %d rcode %d)", request, request->state, request->type, header->rcode));
-        (*request->callback)(request->callback_ctx, NULL, NULL);
-       rem_request(request);
-      }
     }
 
     return;