From b7f7b8128eede6b8fa4fb56d4d9ce1908bb4f6cc Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Sun, 21 Jun 2020 21:17:51 +0100 Subject: [PATCH] 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 7c07129a51e8686d41e2915e83838129219f31f7) --- lib/dns/dnstap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dns/dnstap.c b/lib/dns/dnstap.c index 55efea3f50..093a69b189 100644 --- a/lib/dns/dnstap.c +++ b/lib/dns/dnstap.c @@ -337,7 +337,7 @@ dns_dt_reopen(dns_dtenv_t *env, int roll) { fstrm_iothr_destroy(&env->iothr); } - if (roll != 0) { + if (roll == 0) { roll = env->rolls; } @@ -349,7 +349,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 : env->rolls; + file.versions = roll; file.maximum_size = 0; file.maximum_reached = false; file.suffix = env->suffix;