From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Romain Bellan <romain.bellan@wifirst.fr>
Cc: netfilter-devel@vger.kernel.org,
Florent Fourcot <florent.fourcot@wifirst.fr>
Subject: Re: [PATCH nf-next v4 1/2] netfilter: ctnetlink: add kernel side filtering for dump
Date: Sun, 29 Mar 2020 17:08:21 +0200 [thread overview]
Message-ID: <20200329150821.j6pg42dtbw55ff7s@salvia> (raw)
In-Reply-To: <20200327082632.27129-1-romain.bellan@wifirst.fr>
On Fri, Mar 27, 2020 at 09:26:31AM +0100, Romain Bellan wrote:
> Conntrack dump does not support kernel side filtering (only get exists,
> but it returns only one entry. And user has to give a full valid tuple)
>
> It means that userspace has to implement filtering after receiving many
> irrelevant entries, consuming resources (conntrack table is sometimes
> very huge, much more than a routing table for example).
>
> This patch adds filtering in kernel side. To achieve this goal, we:
>
> * Add a new CTA_FILTER netlink attributes, actually a flag list to
> parametize filtering
> * Convert some *nlattr_to_tuple() functions, to allow a partial parsing
> of CTA_TUPLE_ORIG and CTA_TUPLE_REPLY (so nf_conntrack_tuple it not
> fully set)
>
> Filtering is now possible on:
> * IP SRC/DST values
> * Ports for TCP and UDP flows
> * IMCP(v6) codes types and IDs
>
> Filtering is done has an "AND" operator. For example, when flags
> PROTO_SRC_PORT, PROTO_NUM and IP_SRC are sets, only entries matching all
> values are dumped.
Applied, thanks.
next prev parent reply other threads:[~2020-03-29 15:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-27 8:26 [PATCH nf-next v4 1/2] netfilter: ctnetlink: add kernel side filtering for dump Romain Bellan
2020-03-27 8:26 ` [PATCH nf-next v4 2/2] netfilter: ctnetlink: be more strict when NF_CONNTRACK_MARK is not set Romain Bellan
2020-03-29 15:08 ` Pablo Neira Ayuso
2020-03-29 15:08 ` Pablo Neira Ayuso [this message]
2020-03-30 0:10 ` [PATCH nf-next v4 1/2] netfilter: ctnetlink: add kernel side filtering for dump Pablo Neira Ayuso
2020-03-30 20:53 ` Florent Fourcot
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=20200329150821.j6pg42dtbw55ff7s@salvia \
--to=pablo@netfilter.org \
--cc=florent.fourcot@wifirst.fr \
--cc=netfilter-devel@vger.kernel.org \
--cc=romain.bellan@wifirst.fr \
/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).