mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-28 05:29:48 +00:00
This issue was researched by glebius, and this patch was
incorporated by ISC into the next version of BIND. 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. Approved by: portmgr (krion)
This commit is contained in:
parent
f2bba2e7b3
commit
700756844d
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=140919
23
dns/bind9/files/patch-lib_dns_resolver.c
Normal file
23
dns/bind9/files/patch-lib_dns_resolver.c
Normal file
@ -0,0 +1,23 @@
|
||||
--- lib/dns/resolver.c.orig Tue Feb 8 15:59:44 2005
|
||||
+++ lib/dns/resolver.c Wed Aug 17 02:42:48 2005
|
||||
@@ -2665,7 +2665,7 @@
|
||||
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 @@
|
||||
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);
|
23
dns/bind94/files/patch-lib_dns_resolver.c
Normal file
23
dns/bind94/files/patch-lib_dns_resolver.c
Normal file
@ -0,0 +1,23 @@
|
||||
--- lib/dns/resolver.c.orig Tue Feb 8 15:59:44 2005
|
||||
+++ lib/dns/resolver.c Wed Aug 17 02:42:48 2005
|
||||
@@ -2665,7 +2665,7 @@
|
||||
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 @@
|
||||
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);
|
23
dns/bind95/files/patch-lib_dns_resolver.c
Normal file
23
dns/bind95/files/patch-lib_dns_resolver.c
Normal file
@ -0,0 +1,23 @@
|
||||
--- lib/dns/resolver.c.orig Tue Feb 8 15:59:44 2005
|
||||
+++ lib/dns/resolver.c Wed Aug 17 02:42:48 2005
|
||||
@@ -2665,7 +2665,7 @@
|
||||
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 @@
|
||||
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);
|
23
dns/bind96/files/patch-lib_dns_resolver.c
Normal file
23
dns/bind96/files/patch-lib_dns_resolver.c
Normal file
@ -0,0 +1,23 @@
|
||||
--- lib/dns/resolver.c.orig Tue Feb 8 15:59:44 2005
|
||||
+++ lib/dns/resolver.c Wed Aug 17 02:42:48 2005
|
||||
@@ -2665,7 +2665,7 @@
|
||||
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 @@
|
||||
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);
|
Loading…
Reference in New Issue
Block a user