mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
[master] complete NTA work
3882. [func] By default, negative trust anchors will be tested periodically to see whether data below them can be validated, and if so, they will be allowed to expire early. The "rndc nta -force" option overrides this behvaior. The default NTA lifetime and the recheck frequency can be configured by the "nta-lifetime" and "nta-recheck" options. [RT #36146]
This commit is contained in:
@@ -783,6 +783,7 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx,
|
||||
const char *str;
|
||||
dns_name_t *name;
|
||||
isc_buffer_t b;
|
||||
isc_uint32_t lifetime;
|
||||
|
||||
static intervaltable intervals[] = {
|
||||
{ "cleaning-interval", 60, 28 * 24 * 60 }, /* 28 days */
|
||||
@@ -1153,6 +1154,38 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx,
|
||||
if (tresult != ISC_R_SUCCESS)
|
||||
result = tresult;
|
||||
|
||||
obj = NULL;
|
||||
(void)cfg_map_get(options, "nta-lifetime", &obj);
|
||||
if (obj != NULL) {
|
||||
lifetime = cfg_obj_asuint32(obj);
|
||||
if (lifetime > 86400) {
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"'nta-lifetime' cannot exceed one day");
|
||||
result = ISC_R_RANGE;
|
||||
} else if (lifetime == 0) {
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"'nta-lifetime' may not be zero");
|
||||
result = ISC_R_RANGE;
|
||||
}
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
(void)cfg_map_get(options, "nta-recheck", &obj);
|
||||
if (obj != NULL) {
|
||||
isc_uint32_t recheck = cfg_obj_asuint32(obj);
|
||||
if (recheck > 86400) {
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"'nta-recheck' cannot exceed one day");
|
||||
result = ISC_R_RANGE;
|
||||
}
|
||||
|
||||
if (recheck > lifetime)
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_WARNING,
|
||||
"'nta-recheck' (%d seconds) is "
|
||||
"greater than 'nta-lifetime' "
|
||||
"(%d seconds)", recheck, lifetime);
|
||||
}
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user