From: Mateusz Golicz <mtg@elsat.net.pl>
To: netfilter-devel@lists.netfilter.org
Subject: [BUG] nth match: using more than 1 counter
Date: Sat, 7 Dec 2002 13:49:13 +0100 [thread overview]
Message-ID: <20021207124913.GA15801@fouk.org> (raw)
Hello,
The userspace part of the nth match (BTW, quite an useful one)
seems to be a bit broken. (at least in the CVS version from the
WWW frontend (don't know if there are any other ones ;), i'm
new to netfilter developement): http://cvs.netfilter.org/cgi-bin/cvsweb/~checkout~/netfilter/userspace/extensions/libipt_nth.c)
around line 102, in parse(), there is a fragment doing some
checks concerning the --every option:
--- CUT ---
nthinfo->packet = 0xFF;
if(!(*flags & IPT_NTH_OPT_EVERY))
{
nthinfo->counter = 0;
}
--- CUT ---
... but actually, the IPT_NTH_OPT_EVERY flag is
set only in this function, but after this part. So, if
you specify --every after --counter, the previous nthinfo->counter
will be always lost, which will make the match behave quite improperly in
case you use more than a one counter... i guess this check should be
something like:
--- CUT ---
--- extensions/libipt_nth.c.old Sat Dec 7 05:47:47 2002
+++ extensions/libipt_nth.c Sat Dec 7 05:29:28 2002
@@ -100,7 +101,7 @@
nthinfo->every = num-1;
nthinfo->startat = 0;
nthinfo->packet = 0xFF;
- if(!(*flags & IPT_NTH_OPT_EVERY))
+ if(!(*flags & IPT_NTH_OPT_COUNTER))
{
nthinfo->counter = 0;
}
--- CUT ---
Matthew Golicz, IP Network Dept., Cable Television "Elsat" Ltd.
--
______________________________________________________________________
mteg <mtg@elsat.net.pl> * MG452-RIPE * Mateusz Golicz
* ,,I just had a thought I have seen everything in this lifetime, but*
* now I sit here and watch a cyborg diving ... in her spare time!'' *
next reply other threads:[~2002-12-07 12:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-07 12:49 Mateusz Golicz [this message]
2002-12-09 3:26 ` [BUG] nth match: using more than 1 counter Fabrice MARIE
-- strict thread matches above, loose matches on Subject: below --
2002-12-07 3:58 Mateusz Golicz
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=20021207124913.GA15801@fouk.org \
--to=mtg@elsat.net.pl \
--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.