aboutsummaryrefslogtreecommitdiffstats
path: root/dns/bind910
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2015-07-29 22:36:20 +0800
committermat <mat@FreeBSD.org>2015-07-29 22:36:20 +0800
commitd66598ab8bb60249b84fd1465d79f2e6477cd75e (patch)
tree8a1114d09566c50cfe8b1868adee1775c3b211de /dns/bind910
parentacbc01bf83c25998827d3b6ff0be1e73a55e47e9 (diff)
downloadfreebsd-ports-gnome-d66598ab8bb60249b84fd1465d79f2e6477cd75e.tar.gz
freebsd-ports-gnome-d66598ab8bb60249b84fd1465d79f2e6477cd75e.tar.zst
freebsd-ports-gnome-d66598ab8bb60249b84fd1465d79f2e6477cd75e.zip
Add an option to enable the bind min override ttl patch.
Requested by: Laurent Frigault Sponsored by: Absolight
Diffstat (limited to 'dns/bind910')
-rw-r--r--dns/bind910/Makefile7
-rw-r--r--dns/bind910/files/extrapatch-bind-min-override-ttl78
2 files changed, 83 insertions, 2 deletions
diff --git a/dns/bind910/Makefile b/dns/bind910/Makefile
index 582a0c927a9b..312b2a0eb313 100644
--- a/dns/bind910/Makefile
+++ b/dns/bind910/Makefile
@@ -8,7 +8,7 @@ PORTVERSION= ${ISCVERSION:S/-P/P/}
PORTREVISION= 0
.else
# dns/bind910 here
-PORTREVISION= 0
+PORTREVISION= 1
.endif
CATEGORIES= dns net ipv6
MASTER_SITES= ISC/bind9/${ISCVERSION}
@@ -58,7 +58,8 @@ OPTIONS_RADIO_GOSTDEF= GOST GOST_ASN1
.if !defined(BIND_TOOLS_SLAVE)
OPTIONS_DEFAULT+= RRL
-OPTIONS_DEFINE+= LINKS RPZ_NSIP RPZ_NSDNAME RRL DOCS NEWSTATS GEOIP
+OPTIONS_DEFINE+= LINKS RPZ_NSIP RPZ_NSDNAME RRL DOCS NEWSTATS GEOIP \
+ MINCACHE
OPTIONS_GROUP= DLZ
OPTIONS_GROUP_DLZ= DLZ_POSTGRESQL DLZ_MYSQL DLZ_BDB \
DLZ_LDAP DLZ_FILESYSTEM DLZ_STUB
@@ -81,6 +82,7 @@ GOST_DESC= GOST raw keys (new default)
GOST_ASN1_DESC= GOST using ASN.1
PYTHON_DESC= Build with Python utilities
START_LATE_DESC= Start BIND late in the boot process
+MINCACHE_DESC= Use the mincachettl patch
LINKS_DESC= Create conf file symlinks in ${PREFIX}
NEWSTATS_DESC= Enable alternate xml statistics channel format
@@ -98,6 +100,7 @@ GSSAPI_BASE_DESC= Using Heimdal in base
GSSAPI_HEIMDAL_DESC= Using security/heimdal
GSSAPI_MIT_DESC= Using security/krb5
GSSAPI_NONE_DESC= Disable
+MINCACHE_EXTRA_PATCHES= ${FILESDIR}/extrapatch-bind-min-override-ttl
.if !defined(BIND_TOOLS_SLAVE)
CONFLICTS+= bind-tools-9.*
diff --git a/dns/bind910/files/extrapatch-bind-min-override-ttl b/dns/bind910/files/extrapatch-bind-min-override-ttl
new file mode 100644
index 000000000000..fa6fd7be34fe
--- /dev/null
+++ b/dns/bind910/files/extrapatch-bind-min-override-ttl
@@ -0,0 +1,78 @@
+diff -Nabdur bind-9.6.0-P1.orig/bin/named/config.c bind-9.6.0-P1/bin/named/config.c
+--- bin/named/config.c 2009-05-22 12:24:49.000000000 +0400
++++ bin/named/config.c 2009-05-22 12:31:35.000000000 +0400
+@@ -129,6 +129,8 @@
+ min-roots 2;\n\
+ lame-ttl 600;\n\
+ max-ncache-ttl 10800; /* 3 hours */\n\
++ override-cache-ttl 0; /* do not override */\n\
++ min-cache-ttl 0; /* no minimal, zero is allowed */\n\
+ max-cache-ttl 604800; /* 1 week */\n\
+ transfer-format many-answers;\n\
+ max-cache-size 0;\n\
+diff -Nabdur bind-9.6.0-P1.orig/bin/named/server.c bind-9.6.0-P1/bin/named/server.c
+--- bin/named/server.c 2009-05-22 12:24:49.000000000 +0400
++++ bin/named/server.c 2009-05-22 12:32:18.000000000 +0400
+@@ -1727,6 +1727,16 @@
+ CHECK(mustbesecure(obj, view->resolver));
+
+ obj = NULL;
++ result = ns_config_get(maps, "override-cache-ttl", &obj);
++ INSIST(result == ISC_R_SUCCESS);
++ view->overridecachettl = cfg_obj_asuint32(obj);
++
++ obj = NULL;
++ result = ns_config_get(maps, "min-cache-ttl", &obj);
++ INSIST(result == ISC_R_SUCCESS);
++ view->mincachettl = cfg_obj_asuint32(obj);
++
++ obj = NULL;
+ result = ns_config_get(maps, "max-cache-ttl", &obj);
+ INSIST(result == ISC_R_SUCCESS);
+ view->maxcachettl = cfg_obj_asuint32(obj);
+diff -Nabdur bind-9.6.0-P1.orig/lib/dns/include/dns/view.h bind-9.6.0-P1/lib/dns/include/dns/view.h
+--- lib/dns/include/dns/view.h 2009-05-22 12:24:49.000000000 +0400
++++ lib/dns/include/dns/view.h 2009-05-22 12:29:03.000000000 +0400
+@@ -131,6 +131,8 @@
+ isc_boolean_t provideixfr;
+ isc_boolean_t requestnsid;
+ dns_ttl_t maxcachettl;
++ dns_ttl_t mincachettl;
++ dns_ttl_t overridecachettl;
+ dns_ttl_t maxncachettl;
+ in_port_t dstport;
+ dns_aclenv_t aclenv;
+diff -Nabdur bind-9.6.0-P1.orig/lib/dns/resolver.c bind-9.6.0-P1/lib/dns/resolver.c
+--- lib/dns/resolver.c 2009-05-22 12:24:49.000000000 +0400
++++ lib/dns/resolver.c 2009-05-22 12:30:41.000000000 +0400
+@@ -4054,6 +4054,18 @@
+ }
+
+ /*
++ * Enforce the configure cache TTL override.
++ */
++ if (res->view->overridecachettl)
++ rdataset->ttl = res->view->overridecachettl;
++
++ /*
++ * Enforce the configure minimum cache TTL.
++ */
++ if (rdataset->ttl < res->view->mincachettl)
++ rdataset->ttl = res->view->mincachettl;
++
++ /*
+ * Enforce the configure maximum cache TTL.
+ */
+ if (rdataset->ttl > res->view->maxcachettl)
+diff -Nabdur bind-9.6.0-P1.orig/lib/isccfg/namedconf.c bind-9.6.0-P1/lib/isccfg/namedconf.c
+--- lib/isccfg/namedconf.c 2009-05-22 12:24:49.000000000 +0400
++++ lib/isccfg/namedconf.c 2009-05-22 12:31:21.000000000 +0400
+@@ -821,6 +821,8 @@
+ { "lame-ttl", &cfg_type_uint32, 0 },
+ { "max-acache-size", &cfg_type_sizenodefault, 0 },
+ { "max-cache-size", &cfg_type_sizenodefault, 0 },
++ { "override-cache-ttl", &cfg_type_uint32, 0 },
++ { "min-cache-ttl", &cfg_type_uint32, 0 },
+ { "max-cache-ttl", &cfg_type_uint32, 0 },
+ { "max-clients-per-query", &cfg_type_uint32, 0 },
+ { "max-ncache-ttl", &cfg_type_uint32, 0 },