All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Gardner <tim.gardner@canonical.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Patrick McHardy <kaber@trash.net>, netfilter-devel@vger.kernel.org
Subject: Re: nf-next: netfilter: xt_recent: Add an entry reaper
Date: Tue, 16 Mar 2010 16:58:25 -0600	[thread overview]
Message-ID: <4BA00D11.6030801@canonical.com> (raw)
In-Reply-To: <alpine.LSU.2.01.1003162131130.17804@obet.zrqbmnf.qr>

On 03/16/2010 02:31 PM, Jan Engelhardt wrote:
>
> On Tuesday 2010-03-16 20:43, Tim Gardner wrote:
>>>>
>>>> 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.
>>>
>>> Thanks, this looks fine. My only concern is that we currently
>>> don't catch unknown flags, so userspace won't get an error if
>>> the option is used and the kernel doesn't support it. If you
>>> document this clearly we can ignore it this one time, but I'd
>>> appreciate if you could send me a patch on top to check for
>>> unknown flags and refuse them.
>>>
>>>> Signed-off-by: Tim Gardner<tim.gardner@canonical.com>
>>>
>>> Applied, thanks.
>>
>> Thusly? (attached)
>
> [patch]
>
> Why not make this an enum constant like the rest of the flags?
> It's perfectly fine to say
>
> enum {
> 	a,
> 	c = a | b,
> };
>
> as long as it's const/compile-time-computable.
>

I guess because I'm old school I just hacked out a macro without really 
thinking about it. Its long been my habit to never used a signed 
quantity in a device driver unless signedness is really called for.

rtg
-- 
Tim Gardner tim.gardner@canonical.com

  reply	other threads:[~2010-03-16 22:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 17:09 nf-next: netfilter: xt_recent: Add an entry reaper Tim Gardner
2010-03-16 18:57 ` Patrick McHardy
2010-03-16 19:43   ` Tim Gardner
2010-03-16 20:31     ` Jan Engelhardt
2010-03-16 22:58       ` Tim Gardner [this message]
2010-03-16 23:48         ` Jan Engelhardt
2010-03-17 15:19     ` Patrick McHardy

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=4BA00D11.6030801@canonical.com \
    --to=tim.gardner@canonical.com \
    --cc=jengelh@medozas.de \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.