From: Patrick McHardy <kaber@trash.net>
To: Phil Oester <kernel@linuxace.com>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: [RESEND][PATCH] Recent match jiffies wrap mismatches
Date: Wed, 30 Nov 2005 00:03:42 +0100 [thread overview]
Message-ID: <438CDE4E.8070006@trash.net> (raw)
In-Reply-To: <20051129050813.GA30630@linuxace.com>
Phil Oester wrote:
> Around jiffies wrap time (i.e. within first 5 mins after boot), recent match
> rules which contain both --seconds and --hitcount arguments experience
> false matches.
>
> This is because the last_pkts array is filled with zeros on creation, and
> when comparing 'now' to 0 (+ --seconds argument), time_before_eq thinks it
> has found a hit.
>
> Below patch adds a break if the packet value is zero. This has the unfortunate
> side effect of causing mismatches if a packet was received when jiffies really
> was equal to zero. The odds of that happening are slim compared to the
> problems caused by not adding the break however. Plus, the author used
> this same method just below, so it is "good enough".
Applied, thanks. The lines just above that have the same problem, don't
they?
[slightly reformated for better readability]
if(info->seconds && !info->hit_count) {
if(time_before_eq(now,r_list[location].last_seen+info->seconds*HZ))
ans = !info->invert;
else
ans = info->invert;
}
next prev parent reply other threads:[~2005-11-29 23:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-29 5:08 [RESEND][PATCH] Recent match jiffies wrap mismatches Phil Oester
2005-11-29 23:03 ` Patrick McHardy [this message]
2005-11-29 23:51 ` Phil Oester
2005-11-30 7:43 ` Patrick McHardy
2005-11-30 16:20 ` Phil Oester
2005-11-30 19:13 ` Stephen Frost
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=438CDE4E.8070006@trash.net \
--to=kaber@trash.net \
--cc=kernel@linuxace.com \
--cc=netfilter-devel@lists.netfilter.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.