Skip to content

Commit

Permalink
Dynamic blocks were being created with the wrong duration (the detect…
Browse files Browse the repository at this point in the history
…ion interval was being used).
  • Loading branch information
David Freedman committed Jun 4, 2018
1 parent ce633f7 commit e4dfb2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pdns/dnsdist-dynblocks.hh
Original file line number Diff line number Diff line change
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 e4dfb2e

Please sign in to comment.