netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tim Gardner <timg@tpi.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	kaber@trash.net, coreteam@netfilter.org,
	netfilter-devel@vger.kernel.org, netfilter@vger.kernel.org
Subject: Re: linux-next netfilter: xt_recent: Add an entry reaper
Date: Sun, 28 Feb 2010 15:42:18 -0700	[thread overview]
Message-ID: <4B8AF14A.5030904@tpi.com> (raw)
In-Reply-To: <alpine.LSU.2.01.1002281146470.9681@obet.zrqbmnf.qr>

Jan Engelhardt wrote:
> On Sunday 2010-02-28 05:34, Eric Dumazet wrote:
>>> One of the problems with the way xt_recent is implemented is that
>>> there is no efficient way to remove expired entries.
> 
> Oh there is:
> 
> 	echo "- 2001:db8::1" >/proc/net/xt_recent/foo
> 
>> 2) All entries are flushed when
>> 	echo clear > /proc/net/xt_recent/<tablename>
> 
> 	echo "/" >/proc/net/xt_recent/foo
> 
> it is.
> 
>> 3) You could eventually implement a purge operation to remove all
>> expired entries at will
>>
>>      echo purge > /proc/net/xt_recent/<tablename>
> 
> Entries do not expire (except "falling off" the LRU when it's full) -
> there is no counter that tells them when they expired.
> "--seconds" is just a match option, not something that defines
> the LRU's properties. And that's actually good, because that allows
> you to write
> 
> 	-m recent --name foo --seconds 60 -j do that
> 
> 	-m recent --name foo --seconds 3600 -j do something else
> 
> If you purged "expired" entries after 60 secs, there would be nothing
> left for the 3600 one to check for.
> 

I hadn't really considered your example as a valid use case. It seems to
me that the second rule might also match even after the first rule
matches, but its also very dependent on how you've crafted your rule set.

rtg
-- 
Tim Gardner timg@tpi.com www.tpi.com
OR 503-601-0234 x102 MT 406-443-5357

  parent reply	other threads:[~2010-02-28 22:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-28  3:38 linux-next netfilter: xt_recent: Add an entry reaper Tim Gardner
2010-02-28  4:34 ` Eric Dumazet
2010-02-28 10:50   ` Jan Engelhardt
2010-02-28 20:26     ` Eric Dumazet
2010-02-28 22:42     ` Tim Gardner [this message]
2010-02-28 18:23   ` Tim Gardner
2010-02-28 20:02     ` Jan Engelhardt
2010-02-28 20:20     ` Eric Dumazet
2010-02-28 23:12       ` Tim Gardner
2010-03-01  2:17         ` Eric Dumazet
2010-03-01 20:24           ` Tim Gardner
2010-03-01 20:40             ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B8AF14A.5030904@tpi.com \
    --to=timg@tpi.com \
    --cc=coreteam@netfilter.org \
    --cc=eric.dumazet@gmail.com \
    --cc=jengelh@medozas.de \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).