netfilter: xt_recent: add an entry reaper
authorTim Gardner <tim.gardner@canonical.com>
Tue, 16 Mar 2010 18:53:13 +0000 (19:53 +0100)
committerPatrick McHardy <kaber@trash.net>
Wed, 17 Mar 2010 14:53:12 +0000 (15:53 +0100)
One of the problems with the way xt_recent is implemented is that
there is no efficient way to remove expired entries. Of course,
one can write a rule '-m recent --remove', but you have to know
beforehand which entry to delete. This commit adds reaper
logic which checks the head of the LRU list when a rule
is invoked that has a '--seconds' value and XT_RECENT_REAP set. If an
entry ceases to accumulate time stamps, then it will eventually bubble
to the top of the LRU list where it is then reaped.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>

No differences found