From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>,
netfilter-devel <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH RFC v2] netfilter: add connlabel conntrack extension
Date: Mon, 12 Nov 2012 13:47:05 +0100 [thread overview]
Message-ID: <20121112124705.GC20678@breakpoint.cc> (raw)
In-Reply-To: <20121112065001.GB11330@1984>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > diff --git a/net/netfilter/nf_conntrack_labels.c b/net/netfilter/nf_conntrack_labels.c
> > new file mode 100644
> > index 0000000..eab398b
> > --- /dev/null
> > +++ b/net/netfilter/nf_conntrack_labels.c
> > @@ -0,0 +1,143 @@
> > +#include <linux/ctype.h>
> > +#include <linux/export.h>
> > +#include <linux/jhash.h>
> > +#include <linux/spinlock.h>
> > +#include <linux/types.h>
> > +#include <linux/slab.h>
> > +
> > +#include <net/netfilter/nf_conntrack_ecache.h>
> > +#include <net/netfilter/nf_conntrack_labels.h>
> > +
> > +static int labels_set_realloc(struct nf_conn_labels *l,
> > + struct __nf_conn_labels_rcu_ptr *oldptr, u16 bit)
>
> I think we can simplify this code if we use the CT target to set the
> number of labels that we'll use, so we skip allocations in runtime and
> possible reallocation.
>
> ... -t raw -j CT --labels 32
I'm not convinced yet ;-)
I think we should avoid to make users fiddle with CT target options
just to get certain functionality working.
Alternative would be to keep track of highest bit requested in a "-m connlabel"
rule to figure out the needed size.
In any case, it would require adding "u16 len" to the extension area; else
we can't figure out how many bytes are valid, i.e.:
struct nf_conn_labels {
+ u16 size; /* length of label storage */
+ unsigned long bits[]; /* variable-sized label storage */
+};
it would increase minimum length needed but it would avoid
the rcu dances done by the current scheme.
It this is ok for you I'll make this change to see how many LOC are
saved by this.
next prev parent reply other threads:[~2012-11-12 12:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-02 12:43 [PATCH RFC v2] netfilter: add connlabel conntrack extension Florian Westphal
2012-11-07 20:04 ` Florian Westphal
2012-11-12 6:44 ` Pablo Neira Ayuso
2012-11-12 12:30 ` Florian Westphal
2012-11-12 16:24 ` Pablo Neira Ayuso
2012-11-12 16:32 ` Florian Westphal
2012-11-12 19:02 ` Pablo Neira Ayuso
2012-11-12 6:50 ` Pablo Neira Ayuso
2012-11-12 12:47 ` Florian Westphal [this message]
2012-11-15 12:13 ` Pablo Neira Ayuso
2012-11-15 12:50 ` Florian Westphal
2012-11-15 13:09 ` Pablo Neira Ayuso
2012-11-15 12:52 ` Stephen Clark
2012-11-15 13:06 ` Pablo Neira Ayuso
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=20121112124705.GC20678@breakpoint.cc \
--to=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@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 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).