From e4dfb2eb20e32b51b7da320645bdc4fd0d7782cd Mon Sep 17 00:00:00 2001 From: David Freedman Date: Mon, 4 Jun 2018 12:59:37 +0100 Subject: [PATCH] Dynamic blocks were being created with the wrong duration (the detection interval was being used). --- pdns/dnsdist-dynblocks.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdist-dynblocks.hh b/pdns/dnsdist-dynblocks.hh index 2df9ebbb5..5b896e81c 100644 --- a/pdns/dnsdist-dynblocks.hh +++ b/pdns/dnsdist-dynblocks.hh @@ -203,7 +203,7 @@ private: blocks = g_dynblockNMG.getCopy(); } struct timespec until = now; - until.tv_sec += rule.d_seconds; + until.tv_sec += rule.d_blockDuration; unsigned int count = 0; const auto& got = blocks->lookup(Netmask(requestor)); bool expired = false; @@ -225,7 +225,7 @@ private: DynBlock db{rule.d_blockReason, until, DNSName(), rule.d_action}; db.blocks = count; if (!got || expired) { - warnlog("Inserting dynamic block for %s for %d seconds: %s", requestor.toString(), rule.d_seconds, rule.d_blockReason); + warnlog("Inserting dynamic block for %s for %d seconds: %s", requestor.toString(), rule.d_blockDuration, rule.d_blockReason); } blocks->insert(Netmask(requestor)).second = db; updated = true; -- 2.50.1