Commit e1390b0e authored by Tony Finch's avatar Tony Finch Committed by Mark Andrews
Browse files

Fix `rndc dnstap -roll N`

The `rndc` argument was always overridden by the static configuration,
because the logic for handling the number of dnstap files to retain
was both backwards and a bit redundant.

(cherry picked from commit 7c07129a)
parent bb7d2bb0
......@@ -334,8 +334,13 @@ dns_dt_reopen(dns_dtenv_t *env, int roll) {
generation++;
if (env->iothr != NULL)
if (env->iothr != NULL) {
fstrm_iothr_destroy(&env->iothr);
}
if (roll == 0) {
roll = env->rolls;
}
if (env->mode == dns_dtmode_file && roll >= 0) {
/*
......@@ -345,7 +350,7 @@ dns_dt_reopen(dns_dtenv_t *env, int roll) {
char *filename = isc_mem_strdup(env->mctx, env->path);
file.name = filename;
file.stream = NULL;
file.versions = roll != 0 ? roll : ISC_LOG_ROLLINFINITE;
file.versions = roll;
file.maximum_size = 0;
file.maximum_reached = false;
result = isc_logfile_roll(&file);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment