]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix `rndc dnstap -roll N`
authorTony Finch <dot@dotat.at>
Sun, 21 Jun 2020 20:17:51 +0000 (21:17 +0100)
committerMark Andrews <marka@isc.org>
Tue, 23 Jun 2020 10:20:39 +0000 (20:20 +1000)
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.

lib/dns/dnstap.c

index 42de18f9e41f8656441ca78b43cd104b148cd81c..f6073db991534fa560c972dbe990b8e5b06c4634 100644 (file)
@@ -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;