diff --git a/Utils.h b/Utils.h index ec2190de..b7ff9d1b 100644 --- a/Utils.h +++ b/Utils.h @@ -272,6 +272,13 @@ public: } } + /** + * @brief Clear all entries + */ + void Clear() { + m_mItems.clear(); + } + // Setters void SetTTL(unsigned int u) { m_uTTL = u; } // !Setters diff --git a/modules/fail2ban.cpp b/modules/fail2ban.cpp index 3d20ea62..1ea04252 100644 --- a/modules/fail2ban.cpp +++ b/modules/fail2ban.cpp @@ -38,6 +38,10 @@ public: return true; } + virtual void OnPostRehash() { + m_Cache.Clear(); + } + void Add(const CString& sHost, unsigned int count) { m_Cache.AddItem(sHost, count, m_Cache.GetTTL()); }