From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Dennis Jacobfeuerborn <dennisml@conversis.de>,
netfilter@vger.kernel.org, netfilter-devel@vger.kernel.org
Subject: Re: Nftables HOWTO documentation updates
Date: Wed, 19 Feb 2014 15:59:46 +0000 [thread overview]
Message-ID: <20140219155945.GA9425@macbook.localnet> (raw)
In-Reply-To: <20140219155502.GA18700@localhost>
On Wed, Feb 19, 2014 at 04:55:02PM +0100, Pablo Neira Ayuso wrote:
> >
> > Is it possible to comment rules like in iptables? Comments in
> > iptables made it really easy to manage rules on a logical level i.e.
> > I could define rule "types" by adding a special comment like
> > "TYPE:X" and then use that to grep for these rules to batch-remove
> > them or retrieve the counter values. It would be nice to be able to
> > tag rules like this.
>
> As Arturo said, that's not yet implemented. I've been trying to find a
> way which doesn't involve to store that comment string in the kernel,
> given that this information is not used by the kernel in any way, but
> all what I come out with was overly complicated and not nice.
>
> So, assuming we store this comment string in kernel-space, I see
> several possibilities at this moment:
>
> * Add an expression for comments, which is sort of abuse since we'll
> iterate in nft_do_chain() over one expression which does nothing,
> so it adds some runtime overhead to the packet handling. This is
> what the iptables comment match current does, btw.
>
> * Adding a comment field to nft_rule structure, which means that we
> have to consume a 4/8 extra bytes in the nft_rule structure for a
> feature that may not be used by everyone.
>
> * Attach this this at the end of the expression data area (but *not*
> abusing the expression infrastructure). I think this has no runtime
> overhead and no extra memory consumption for those that don't need
> this comment feature, so it's the way to go IMO.
Sounds very reasonable. I'd suggest to not make this specific to comments,
but simply call it "userdata" or something so we we can put whatever we
like in there. Interpretation would be up to userspace.
prev parent reply other threads:[~2014-02-19 15:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-18 11:25 Nftables HOWTO documentation updates Pablo Neira Ayuso
2014-02-19 15:13 ` Dennis Jacobfeuerborn
2014-02-19 15:48 ` Arturo Borrero Gonzalez
2014-02-19 15:55 ` Pablo Neira Ayuso
2014-02-19 15:59 ` Patrick McHardy [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=20140219155945.GA9425@macbook.localnet \
--to=kaber@trash.net \
--cc=dennisml@conversis.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=netfilter@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).