From 8578c3b27258cf65de7d1d9614bd56dc58901823 Mon Sep 17 00:00:00 2001 From: Alex Badea Date: Mon, 17 Oct 2005 17:37:00 +0000 Subject: [PATCH] Author: Diane Bruce (by way of Vampire- ) 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 | 6 ++++++ ircd/ircd_res.c | 20 +++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6bb6fa9..0b5c602 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-10-17 Diane Bruce + + * 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 * include/patchlevel.h (PATCHLEVEL): Update to pre02. diff --git a/ircd/ircd_res.c b/ircd/ircd_res.c index 0996822..6467aba 100644 --- a/ircd/ircd_res.c +++ b/ircd/ircd_res.c @@ -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; -- 2.20.1