From: Stefano Brivio <sbrivio@redhat.com>
To: Jozsef Kadlecsik <kadlec@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, Mithil Mhatre <mmhatre@redhat.com>
Subject: Re: [PATCH] ipset: Update byte and packet counters regardless of whether they match
Date: Fri, 28 Feb 2020 13:28:48 +0100 [thread overview]
Message-ID: <20200228132848.4a0bf4b7@redhat.com> (raw)
In-Reply-To: <20200228124039.00e5a343@redhat.com>
On Fri, 28 Feb 2020 12:40:39 +0100
Stefano Brivio <sbrivio@redhat.com> wrote:
> Hi Jozsef,
>
> On Thu, 27 Feb 2020 21:37:10 +0100 (CET)
> Jozsef Kadlecsik <kadlec@netfilter.org> wrote:
>
> > Hi Stefano,
> >
> > On Tue, 25 Feb 2020, Stefano Brivio wrote:
> >
> > > On Tue, 25 Feb 2020 21:37:45 +0100 (CET)
> > > Jozsef Kadlecsik <kadlec@netfilter.org> wrote:
> > >
> > > > On Tue, 25 Feb 2020, Stefano Brivio wrote:
> > > >
> > > > > > The logic could be changed in the user rules from
> > > > > >
> > > > > > iptables -I INPUT -m set --match-set c src --bytes-gt 800 -j DROP
> > > > > >
> > > > > > to
> > > > > >
> > > > > > iptables -I INPUT -m set --match-set c src --bytes-lt 800 -j ACCEPT
> > > > > > [ otherwise DROP ]
> > > > > >
> > > > > > but of course it might be not so simple, depending on how the rules are
> > > > > > built up.
> > > > >
> > > > > Yes, it would work, unless the user actually wants to check with the
> > > > > same counter how many bytes are sent "in excess".
> > > >
> > > > You mean the counters are still updated whenever the element is matched in
> > > > the set and then one could check how many bytes were sent over the
> > > > threshold just by listing the set elements.
> > >
> > > Yes, exactly -- note that it was possible (and, I think, used) before.
> >
> > I'm still not really convinced about such a feature. Why is it useful to
> > know how many bytes would be sent over the "limit"?
>
> This is useful in case one wants different treatments for packets
> according to a number of thresholds in different rules. For example,
>
> iptables -I INPUT -m set --match-set c src --bytes-lt 100 -j noise
> iptables -I noise -m set --match-set c src --bytes-lt 20000 -j download
^^ gt, of
course :)
--
Stefano
next prev parent reply other threads:[~2020-02-28 12:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-24 17:52 [PATCH] ipset: Update byte and packet counters regardless of whether they match Stefano Brivio
2020-02-25 8:07 ` Jozsef Kadlecsik
2020-02-25 8:40 ` Stefano Brivio
2020-02-25 9:16 ` Jozsef Kadlecsik
2020-02-25 12:22 ` Stefano Brivio
2020-02-25 20:37 ` Jozsef Kadlecsik
2020-02-25 20:53 ` Stefano Brivio
2020-02-27 20:37 ` Jozsef Kadlecsik
2020-02-28 11:40 ` Stefano Brivio
2020-02-28 12:28 ` Stefano Brivio [this message]
2020-03-03 9:36 ` Jozsef Kadlecsik
2020-03-03 22:16 ` Stefano Brivio
2020-03-09 10:07 ` Jozsef Kadlecsik
2020-04-08 16:09 ` Phil Sutter
2020-04-08 19:59 ` Jozsef Kadlecsik
2020-04-08 20:20 ` Stefano Brivio
2020-04-08 21:40 ` Jozsef Kadlecsik
2020-04-09 9:16 ` Phil Sutter
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=20200228132848.4a0bf4b7@redhat.com \
--to=sbrivio@redhat.com \
--cc=kadlec@netfilter.org \
--cc=mmhatre@redhat.com \
--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.