From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next v4 3/3] netfilter: nftables: add connlabel set support
Date: Tue, 15 Mar 2016 03:14:00 +0100 [thread overview]
Message-ID: <20160315021400.GA24921@salvia> (raw)
In-Reply-To: <1457964554-13907-1-git-send-email-fw@strlen.de>
Hi Florian,
On Mon, Mar 14, 2016 at 03:09:14PM +0100, Florian Westphal wrote:
> Conntrack labels are currently sized depending on the iptables
> ruleset, i.e. if we're asked to test or set bits 1, 2, and 65 then we
> would allocate enough room to store at least bit 65.
>
> However, with nft, the input is just a register with arbitrary runtime
> content.
>
> We therefore ask for the upper ceiling we currently have, which is
> enough room to store 128 bits.
We can probably allow passing the label value as attribute to the
nft_ct expression so you don't have to use the upper ceiling. Patrick
suggested something similar for nft_ct set helper support.
BTW, during NetDev 0.1 he also suggested an alternative to maps that
would suit well for this case, the idea is to use the NFT_SET_EXT_EXPR
to store the connlabel set expression and build a dictionary as
alternative, it would be something like:
ip saddr map {
1.2.3.4 : connlabel bitset foo,
}
So based on the source IP address, for the matching key we run the
expression on the data part of the element.
> Alternatively, we could alter nf_connlabel_replace to increase
> net->ct.label_words at run time, but since 128 bits is not that
> big we'd only save sizeof(long) so it doesn't seem worth it for now.
That's right, we save little memory.
Sorry for this late spinning on this, giving another think after
looking at nf_connlabels_replace() that we don't have it xt_connlabel.
prev parent reply other threads:[~2016-03-15 2:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-14 13:46 [PATCH nf-next resend 0/3] netfilter: connlabel set support Florian Westphal
2016-03-14 13:46 ` [PATCH nf-next v3 1/3] netfilter: connlabels: move helpers to xt_connlabel Florian Westphal
2016-03-14 13:46 ` [PATCH nf-next v3 2/3] netfilter: labels: don't emit ct event if labels are unchanged Florian Westphal
2016-03-14 13:46 ` [PATCH nf-next v3 3/3] netfilter: nftables: add connlabel set support Florian Westphal
2016-03-14 13:57 ` kbuild test robot
2016-03-14 14:09 ` [PATCH nf-next v4 " Florian Westphal
2016-03-15 2:14 ` Pablo Neira Ayuso [this message]
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=20160315021400.GA24921@salvia \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--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 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).