Skip to content

Commit

Permalink
Merge pull request #6706 from claranet/fix-dynblock-duration
Browse files Browse the repository at this point in the history
Dynamic blocks were being created with the wrong duration
  • Loading branch information
rgacogne committed Jun 4, 2018
2 parents 616f2e4 + e4dfb2e commit 7b1cf12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pdns/dnsdist-dynblocks.hh
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 7b1cf12

Please sign in to comment.