From: Michael Poole Date: Thu, 16 Feb 2006 04:04:25 +0000 (+0000) Subject: Handle NXDOMAIN DNS errors. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=38d3bb2b5c9d0a9ec9aa8264ea776d35edeffeb0 Handle NXDOMAIN DNS errors. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1621 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 8e6a0fd..4183937 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-02-15 Michael Poole + + * include/res.h (NXDOMAIN): Define. + + * ircd/ircd_res.c (res_readreply): Treat NXDOMAIN just like + SERVFAIL. Patch courtesy of Dianora. + + * tools/iauth-test (Carp): This doesn't actually use Carp. + 2006-02-15 Michael Poole * doc/example.conf: Include new HIS_STATS_IAUTH feature. diff --git a/include/res.h b/include/res.h index beb1e4b..50f9324 100644 --- a/include/res.h +++ b/include/res.h @@ -45,6 +45,7 @@ struct StatDesc; #define QUERY 0 /**< Forward (normal) DNS query operation. */ #define NO_ERRORS 0 /**< No errors processing a query. */ #define SERVFAIL 2 /**< Server error while processing a query. */ +#define NXDOMAIN 3 /**< Domain name in query does not exist. */ #define T_A 1 /**< Hostname -> IPv4 query type. */ #define T_AAAA 28 /**< Hostname -> IPv6 query type. */ #define T_PTR 12 /**< IP(v4 or v6) -> hostname query type. */ diff --git a/ircd/ircd_res.c b/ircd/ircd_res.c index 52d6865..02ca4e4 100644 --- a/ircd/ircd_res.c +++ b/ircd/ircd_res.c @@ -784,7 +784,7 @@ res_readreply(struct Event *ev) if ((header->rcode != NO_ERRORS) || (header->ancount == 0)) { - if (SERVFAIL == header->rcode) + if (SERVFAIL == header->rcode || NXDOMAIN == header->rcode) { /* * If a bad error was returned, we stop here and don't send diff --git a/tools/iauth-test b/tools/iauth-test index 2629b52..591e9f6 100755 --- a/tools/iauth-test +++ b/tools/iauth-test @@ -11,7 +11,6 @@ use strict; use warnings; use vars qw(%pending); -use Carp; # for carp use Config; # for $Config{sig_name} and $Config{sig_num} use FileHandle; # for autoflush method on file handles