From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH V2 lnf-ct 2/2] conntrack: snprintf: add connlabel format specifier
Date: Tue, 25 Jun 2013 21:43:47 +0200 [thread overview]
Message-ID: <20130625194347.GA28818@breakpoint.cc> (raw)
In-Reply-To: <20130625153959.GA5883@localhost>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Sun, Jun 23, 2013 at 11:14:39PM +0200, Florian Westphal wrote:
> > By default, nfct_snprintf will not print connlabels, as they're
> > system specific and can easily generate lots of output.
> >
> > This adds a fmt attribute to print connlabel names.
> > +static int
> > +__snprintf_clabels(char *buf, unsigned int len,
> > + const struct nf_conntrack *ct)
> > +{
> > + const struct nfct_bitmask *b = nfct_get_attr(ct, ATTR_CONNLABELS);
> > + struct nfct_labelmap *map;
> > + int ret, size = 0, offset = 0;
> > +
> > + if (!b)
> > + return 0;
> > +
> > + map = nfct_labelmap_new(NULL);
> > + if (!map)
> > + return 0;
>
> This opens and parses the map file for each conntrack, it would be
> expensive. I think it's better provide more control to the client
> regarding the load of the mapping, it's more flexible.
>
> Consider adding:
>
> int nfct_snprintf_connlabel(char *buf, unsigned int len,
> const struct nf_conntrack *ct,
> const struct nfct_labelmap *labelmap);
Thats what I'll do.
Thanks!
prev parent reply other threads:[~2013-06-25 19:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-23 21:14 [PATCH lnf-ct 1/2] conntrack: labels: skip labels with non-alnum characters Florian Westphal
2013-06-23 21:14 ` [PATCH V2 lnf-ct 2/2] conntrack: snprintf: add connlabel format specifier Florian Westphal
2013-06-25 15:39 ` Pablo Neira Ayuso
2013-06-25 19:43 ` Florian Westphal [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=20130625194347.GA28818@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 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.