From: Tim Gardner <timg@tpi.com>
To: Patrick McHardy <kaber@trash.net>
Cc: Thomas Jarosch <thomas.jarosch@intra2net.com>,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] xt_recent: Fix false hit_count match
Date: Fri, 19 Mar 2010 10:38:42 -0600 [thread overview]
Message-ID: <4BA3A892.8010303@tpi.com> (raw)
In-Reply-To: <4BA3A736.6010900@trash.net>
On 03/19/2010 10:32 AM, Patrick McHardy wrote:
> Thomas Jarosch wrote:
>> On Friday, 19. March 2010 16:41:49 you wrote:
>>
>>>> Maybe this is related to the xt_recent
>>>> proc interface creating the entry
>>>> (with a zero hit count)?
>>>>
>>> Mhh, looking at that patch again, I think it should actually do:
>>>
>>> if (!info->hit_count || ++hits>= info->hit_count)
>>> ...
>>>
>>> since a hit_count of 0 implies that the user just wants to check for the
>>> presence of the entry. Thomas, could you give that a try?
>>>
>>
>> The new code works. Isn't that almost the same as reverting
>> the original patch? info->hit_count == 0 will match again.
>>
>> So we could just go back to
>>
>> "if (++hits>= info->hit_count)"
>>
>> Or am I missing something?
>>
>
> I think you're right. Tim, please remind me, why was the match on zero
> hits considered a false positive?
>
Because it looked like it? Maybe its just whining after the fact, but 3
of us missed that it was also an exit condition. IMHO it was too subtle.
I like your final patch much better because, as Thomas pointed out, it
makes it a bit clearer what that clause is doing.
rtg
--
Tim Gardner timg@tpi.com www.tpi.com
OR 503-601-0234 x102 MT 406-443-5357
next prev parent reply other threads:[~2010-03-19 16:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-19 17:49 [PATCH] xt_recent: Fix false hit_count match Tim Gardner
2010-02-23 13:59 ` Patrick McHardy
2010-03-19 15:04 ` Thomas Jarosch
2010-03-19 15:41 ` Patrick McHardy
2010-03-19 16:14 ` Tim Gardner
2010-03-19 16:19 ` Thomas Jarosch
2010-03-19 16:32 ` Patrick McHardy
2010-03-19 16:38 ` Tim Gardner [this message]
2010-03-22 17:31 ` Patrick McHardy
2010-03-22 19:14 ` Thomas Jarosch
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=4BA3A892.8010303@tpi.com \
--to=timg@tpi.com \
--cc=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
--cc=thomas.jarosch@intra2net.com \
/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).