summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2005-08-18 18:39:31 +0000
committerDoug Barton <dougb@FreeBSD.org>2005-08-18 18:39:31 +0000
commitadaaaab975815edcabdc20da6c7f0ad57ca75402 (patch)
tree94f0a1268badff1391a4542e5c6e8055f4f2bdd5
parent94b2911216c7f9fa6d184fa2e43c0aecb7744bbb (diff)
downloadsrc-test2-adaaaab975815edcabdc20da6c7f0ad57ca75402.tar.gz
src-test2-adaaaab975815edcabdc20da6c7f0ad57ca75402.zip
Update the vendor branch with a patch to this file that was
researched by glebius, and incorporated by ISC into the next version of BIND. Unfortunately, it looks like their release will come after the release of FreeBSD 6, so we will bring this in now. The patch addresses a problem with high-load resolvers which hit memory barriers. Without this patch, running the resolving name server out of memory would lead to "unpredictable results." Of course, the canonical answer to this problem is to put more memory into the system, however that is not always possible, and the code should be able to handle this situation gracefully in any case.
Notes
Notes: svn path=/vendor/bind9/dist/; revision=149245
-rw-r--r--contrib/bind9/lib/dns/resolver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/bind9/lib/dns/resolver.c b/contrib/bind9/lib/dns/resolver.c
index 90af5b020e7b..790a2f41686f 100644
--- a/contrib/bind9/lib/dns/resolver.c
+++ b/contrib/bind9/lib/dns/resolver.c
@@ -2665,7 +2665,7 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
unsigned int options, unsigned int bucketnum, fetchctx_t **fctxp)
{
fetchctx_t *fctx;
- isc_result_t result = ISC_R_SUCCESS;
+ isc_result_t result;
isc_result_t iresult;
isc_interval_t interval;
dns_fixedname_t qdomain;
@@ -2687,8 +2687,10 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
strcat(buf, "/"); /* checked */
strcat(buf, typebuf); /* checked */
fctx->info = isc_mem_strdup(res->mctx, buf);
- if (fctx->info == NULL)
+ if (fctx->info == NULL) {
+ result = ISC_R_NOMEMORY;
goto cleanup_fetch;
+ }
FCTXTRACE("create");
dns_name_init(&fctx->name, NULL);
result = dns_name_dup(name, res->mctx, &fctx->name);