diff options
author | Internet Software Consortium, Inc <@isc.org> | 2007-09-07 14:14:21 -0600 |
---|---|---|
committer | LaMont Jones <lamont@debian.org> | 2007-09-07 14:14:21 -0600 |
commit | c37e760642189d2b245b58879c4a7683488b52e4 (patch) | |
tree | 2bc68bd37ae6ea2ad1ca4c636a817d071b6f8af4 /lib | |
parent | e7ee4f9689939f41f745d8ccaae351444c6aed73 (diff) | |
download | bind9-c37e760642189d2b245b58879c4a7683488b52e4.tar.gz |
9.2.1
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dns/api | 6 | ||||
-rw-r--r-- | lib/dns/include/dns/name.h | 5 | ||||
-rw-r--r-- | lib/dns/include/dns/rdataset.h | 5 | ||||
-rw-r--r-- | lib/dns/resolver.c | 105 | ||||
-rw-r--r-- | lib/isc/task.c | 4 | ||||
-rw-r--r-- | lib/isccfg/api | 2 | ||||
-rw-r--r-- | lib/isccfg/check.c | 17 | ||||
-rw-r--r-- | lib/isccfg/win32/libisccfg.mak | 16 |
8 files changed, 92 insertions, 68 deletions
diff --git a/lib/dns/api b/lib/dns/api index b68bc303..f0755020 100644 --- a/lib/dns/api +++ b/lib/dns/api @@ -1,3 +1,3 @@ -LIBINTERFACE = 7 -LIBREVISION = 1 -LIBAGE = 2 +LIBINTERFACE = 8 +LIBREVISION = 0 +LIBAGE = 3 diff --git a/lib/dns/include/dns/name.h b/lib/dns/include/dns/name.h index 12e97108..8995b53b 100644 --- a/lib/dns/include/dns/name.h +++ b/lib/dns/include/dns/name.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001 Internet Software Consortium. + * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.h,v 1.95 2001/08/28 03:58:19 marka Exp $ */ +/* $Id: name.h,v 1.95.2.2 2002/04/23 02:28:51 marka Exp $ */ #ifndef DNS_NAME_H #define DNS_NAME_H 1 @@ -209,6 +209,7 @@ struct dns_name { #define DNS_NAMEATTR_ANSWER 0x0200 /* Used by resolver. */ #define DNS_NAMEATTR_NCACHE 0x0400 /* Used by resolver. */ #define DNS_NAMEATTR_CHAINING 0x0800 /* Used by resolver. */ +#define DNS_NAMEATTR_CHASE 0x1000 /* Used by resolver. */ LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_rootname; extern dns_name_t *dns_wildcardname; diff --git a/lib/dns/include/dns/rdataset.h b/lib/dns/include/dns/rdataset.h index 2281fb5b..c434cade 100644 --- a/lib/dns/include/dns/rdataset.h +++ b/lib/dns/include/dns/rdataset.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2001 Internet Software Consortium. + * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdataset.h,v 1.41 2001/08/28 03:58:21 marka Exp $ */ +/* $Id: rdataset.h,v 1.41.2.2 2002/04/23 02:28:52 marka Exp $ */ #ifndef DNS_RDATASET_H #define DNS_RDATASET_H 1 @@ -128,6 +128,7 @@ struct dns_rdataset { #define DNS_RDATASETATTR_TTLADJUSTED 0x0200 /* Used by message.c */ #define DNS_RDATASETATTR_FIXEDORDER 0x0400 #define DNS_RDATASETATTR_RANDOMIZE 0x0800 +#define DNS_RDATASETATTR_CHASE 0x1000 /* Used by resolver. */ void dns_rdataset_init(dns_rdataset_t *rdataset); diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index f52bdb16..4c1eeb0a 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.218.2.9 2002/03/26 00:54:58 marka Exp $ */ +/* $Id: resolver.c,v 1.218.2.10 2002/04/19 01:11:16 marka Exp $ */ #include <config.h> @@ -2427,6 +2427,7 @@ clone_results(fetchctx_t *fctx) { #define ANSWERSIG(r) (((r)->attributes & DNS_RDATASETATTR_ANSWERSIG) != 0) #define EXTERNAL(r) (((r)->attributes & DNS_RDATASETATTR_EXTERNAL) != 0) #define CHAINING(r) (((r)->attributes & DNS_RDATASETATTR_CHAINING) != 0) +#define CHASE(r) (((r)->attributes & DNS_RDATASETATTR_CHASE) != 0) /* @@ -3240,6 +3241,13 @@ mark_related(dns_name_t *name, dns_rdataset_t *rdataset, rdataset->ttl = 1; } else rdataset->trust = dns_trust_additional; + /* + * Avoid infinite loops by only marking new rdatasets. + */ + if (!CACHE(rdataset)) { + name->attributes |= DNS_NAMEATTR_CHASE; + rdataset->attributes |= DNS_RDATASETATTR_CHASE; + } rdataset->attributes |= DNS_RDATASETATTR_CACHE; if (external) rdataset->attributes |= DNS_RDATASETATTR_EXTERNAL; @@ -3262,58 +3270,66 @@ check_related(void *arg, dns_name_t *addname, dns_rdatatype_t type) { else gluing = ISC_FALSE; name = NULL; - rdataset = NULL; result = dns_message_findname(fctx->rmessage, DNS_SECTION_ADDITIONAL, addname, dns_rdatatype_any, 0, &name, NULL); if (result == ISC_R_SUCCESS) { external = ISC_TF(!dns_name_issubdomain(name, &fctx->domain)); - if (type == dns_rdatatype_a) { - for (rdataset = ISC_LIST_HEAD(name->list); - rdataset != NULL; - rdataset = ISC_LIST_NEXT(rdataset, link)) { - if (rdataset->type == dns_rdatatype_sig) - rtype = rdataset->covers; - else - rtype = rdataset->type; - if (rtype == dns_rdatatype_a || - rtype == dns_rdatatype_aaaa || - rtype == dns_rdatatype_a6) - mark_related(name, rdataset, external, - gluing); - /* - * XXXRTH Need to do a controlled recursion - * on the A6 prefix names to mark - * any additional data related to them. - * - * Ick. - */ - } - } else { - result = dns_message_findtype(name, type, 0, - &rdataset); - if (result == ISC_R_SUCCESS) { - mark_related(name, rdataset, external, gluing); - /* - * Do we have its SIG too? - */ - result = dns_message_findtype(name, - dns_rdatatype_sig, - type, &rdataset); - if (result == ISC_R_SUCCESS) - mark_related(name, rdataset, external, - gluing); - } + for (rdataset = ISC_LIST_HEAD(name->list); + rdataset != NULL; + rdataset = ISC_LIST_NEXT(rdataset, link)) { + if (rdataset->type == dns_rdatatype_sig) + rtype = rdataset->covers; + else + rtype = rdataset->type; + if ((type == dns_rdatatype_a && + (rtype == dns_rdatatype_a || + rtype == dns_rdatatype_aaaa || + rtype == dns_rdatatype_a6)) || + type == rtype) + mark_related(name, rdataset, external, + gluing); } - /* - * XXXRTH Some other stuff still needs to be marked. - * See query.c. - */ } return (ISC_R_SUCCESS); } +static void +chase_additional(fetchctx_t *fctx) { + isc_boolean_t rescan; + dns_section_t section = DNS_SECTION_ADDITIONAL; + isc_result_t result; + + again: + rescan = ISC_FALSE; + + for (result = dns_message_firstname(fctx->rmessage, section); + result == ISC_R_SUCCESS; + result = dns_message_nextname(fctx->rmessage, section)) { + dns_name_t *name = NULL; + dns_rdataset_t *rdataset; + dns_message_currentname(fctx->rmessage, DNS_SECTION_ADDITIONAL, + &name); + if ((name->attributes & DNS_NAMEATTR_CHASE) == 0) + continue; + name->attributes &= ~DNS_NAMEATTR_CHASE; + for (rdataset = ISC_LIST_HEAD(name->list); + rdataset != NULL; + rdataset = ISC_LIST_NEXT(rdataset, link)) { + if (CHASE(rdataset)) { + rdataset->attributes &= ~DNS_RDATASETATTR_CHASE; + (void)dns_rdataset_additionaldata(rdataset, + check_related, + fctx); + rescan = ISC_TRUE; + } + } + } + if (rescan) + goto again; +} + static inline isc_result_t cname_target(dns_rdataset_t *rdataset, dns_name_t *tname) { isc_result_t result; @@ -4351,6 +4367,11 @@ resquery_response(isc_task_t *task, isc_event_t *event) { } /* + * Follow A6 and other additional section data chains. + */ + chase_additional(fctx); + + /* * Cache the cacheable parts of the message. This may also cause * work to be queued to the DNSSEC validator. */ diff --git a/lib/isc/task.c b/lib/isc/task.c index 2dfcc5c9..c49e866d 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001 Internet Software Consortium. + * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: task.c,v 1.85.2.1 2002/03/29 01:41:01 marka Exp $ */ +/* $Id: task.c,v 1.85.2.2 2002/04/23 02:28:54 marka Exp $ */ /* * Principal Author: Bob Halley diff --git a/lib/isccfg/api b/lib/isccfg/api index 7931195a..ae2943dd 100644 --- a/lib/isccfg/api +++ b/lib/isccfg/api @@ -1,3 +1,3 @@ LIBINTERFACE = 0 -LIBREVISION = 2 +LIBREVISION = 3 LIBAGE = 0 diff --git a/lib/isccfg/check.c b/lib/isccfg/check.c index 2fe46e3a..b762c73b 100644 --- a/lib/isccfg/check.c +++ b/lib/isccfg/check.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: check.c,v 1.14.2.15 2002/03/20 20:21:15 marka Exp $ */ +/* $Id: check.c,v 1.14.2.16 2002/04/23 02:00:03 marka Exp $ */ #include <config.h> @@ -261,13 +261,14 @@ check_zoneconf(cfg_obj_t *zconfig, isc_symtab_t *symtab, isc_log_t *logctx, "zone '%s': missing 'masters' entry", zname); result = ISC_R_FAILURE; - } - addrlist = cfg_tuple_get(obj, "addresses"); - if (cfg_list_first(addrlist) == NULL) { - cfg_obj_log(zoptions, logctx, ISC_LOG_ERROR, - "zone '%s': empty 'masters' entry", - zname); - result = ISC_R_FAILURE; + } else { + addrlist = cfg_tuple_get(obj, "addresses"); + if (cfg_list_first(addrlist) == NULL) { + cfg_obj_log(zoptions, logctx, ISC_LOG_ERROR, + "zone '%s': empty 'masters' entry", + zname); + result = ISC_R_FAILURE; + } } } diff --git a/lib/isccfg/win32/libisccfg.mak b/lib/isccfg/win32/libisccfg.mak index c0eee0ac..a7c09380 100644 --- a/lib/isccfg/win32/libisccfg.mak +++ b/lib/isccfg/win32/libisccfg.mak @@ -297,24 +297,24 @@ SOURCE=.\version.c !IF "$(CFG)" == "libisccfg - Win32 Release" "libisc - Win32 Release" : - cd "\bind-9.2.1rc1\lib\isc\win32" + cd "..\..\isc\win32" $(MAKE) /$(MAKEFLAGS) /F ".\libisc.mak" CFG="libisc - Win32 Release" cd "..\..\isccfg\win32" "libisc - Win32 ReleaseCLEAN" : - cd "\bind-9.2.1rc1\lib\isc\win32" + cd "..\..\isc\win32" $(MAKE) /$(MAKEFLAGS) /F ".\libisc.mak" CFG="libisc - Win32 Release" RECURSE=1 CLEAN cd "..\..\isccfg\win32" !ELSEIF "$(CFG)" == "libisccfg - Win32 Debug" "libisc - Win32 Debug" : - cd "\bind-9.2.1rc1\lib\isc\win32" + cd "..\..\isc\win32" $(MAKE) /$(MAKEFLAGS) /F ".\libisc.mak" CFG="libisc - Win32 Debug" cd "..\..\isccfg\win32" "libisc - Win32 DebugCLEAN" : - cd "\bind-9.2.1rc1\lib\isc\win32" + cd "..\..\isc\win32" $(MAKE) /$(MAKEFLAGS) /F ".\libisc.mak" CFG="libisc - Win32 Debug" RECURSE=1 CLEAN cd "..\..\isccfg\win32" @@ -323,24 +323,24 @@ SOURCE=.\version.c !IF "$(CFG)" == "libisccfg - Win32 Release" "libdns - Win32 Release" : - cd "\bind-9.2.1rc1\lib\dns\win32" + cd "..\..\dns\win32" $(MAKE) /$(MAKEFLAGS) /F ".\libdns.mak" CFG="libdns - Win32 Release" cd "..\..\isccfg\win32" "libdns - Win32 ReleaseCLEAN" : - cd "\bind-9.2.1rc1\lib\dns\win32" + cd "..\..\dns\win32" $(MAKE) /$(MAKEFLAGS) /F ".\libdns.mak" CFG="libdns - Win32 Release" RECURSE=1 CLEAN cd "..\..\isccfg\win32" !ELSEIF "$(CFG)" == "libisccfg - Win32 Debug" "libdns - Win32 Debug" : - cd "\bind-9.2.1rc1\lib\dns\win32" + cd "..\..\dns\win32" $(MAKE) /$(MAKEFLAGS) /F ".\libdns.mak" CFG="libdns - Win32 Debug" cd "..\..\isccfg\win32" "libdns - Win32 DebugCLEAN" : - cd "\bind-9.2.1rc1\lib\dns\win32" + cd "..\..\dns\win32" $(MAKE) /$(MAKEFLAGS) /F ".\libdns.mak" CFG="libdns - Win32 Debug" RECURSE=1 CLEAN cd "..\..\isccfg\win32" |