From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 1/7] netfilter: nf_tables: deconstify table and chain in context structure
Date: Fri, 28 Mar 2014 13:57:41 +0100 [thread overview]
Message-ID: <20140328125741.GA13685@localhost> (raw)
In-Reply-To: <20140328124229.GB7895@macbook.localnet>
On Fri, Mar 28, 2014 at 12:42:29PM +0000, Patrick McHardy wrote:
> On Thu, Mar 27, 2014 at 10:53:11PM +0100, Pablo Neira Ayuso wrote:
> > The new transaction infrastructure updates the family, table and chain
> > objects in the context structure, so let's deconstify them. While at it,
> > move the context structure initialization routine to the top of the
> > source file as it will be also used from the table and chain routines.
>
> I would prefer to keep the consts for the context, but I'm fine with it
> if we don't find a clean other way. Basically I'd suggest to use your
> patch if we have functions that are called from both the transaction
> code and non-transaction code, IOW need the nft_ctx structure.
> Otherwise, if this stuff is only used by the transaction code, we could
> add the individual members to the transaction as non-consts.
This is being used from both transaction and non-transaction code. I
initially casted this to non-const as a workaround to calm down gcc,
but at some point I needed the list handling to add and to remove
elements from the lists which was quite ugly. I liked those compile
time checkings that we were getting before this.
Another possibility is to add some nft_ctx_trans which would look very
similar to nft_ctx, but in some cases we would need to define both
nft_ctx and nft_ctx_trans, which doesn't look very nice either. So I
don't see a better way to make this at this moment.
next prev parent reply other threads:[~2014-03-28 13:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-27 21:53 [PATCH 0/7] new transaction infrastructure for nf_tables Pablo Neira Ayuso
2014-03-27 21:53 ` [PATCH 1/7] netfilter: nf_tables: deconstify table and chain in context structure Pablo Neira Ayuso
2014-03-28 12:42 ` Patrick McHardy
2014-03-28 12:57 ` Pablo Neira Ayuso [this message]
2014-03-27 21:53 ` [PATCH 2/7] netfilter: nf_tables: generalise transaction infrastructure Pablo Neira Ayuso
2014-03-28 12:42 ` Patrick McHardy
2014-03-27 21:53 ` [PATCH 3/7] netfilter: nf_tables: relocate commit and abort routines in the source file Pablo Neira Ayuso
2014-03-27 21:53 ` [PATCH 4/7] netfilter: nf_tables: better encapsulation for the rule transaction code Pablo Neira Ayuso
2014-03-28 12:53 ` Patrick McHardy
2014-03-27 21:53 ` [PATCH 5/7] netfilter: nf_tables: move set handling to the transaction infrastructure Pablo Neira Ayuso
2014-03-28 13:00 ` Patrick McHardy
2014-03-27 21:53 ` [PATCH 6/7] netfilter: nf_tables: move chain " Pablo Neira Ayuso
2014-03-28 13:10 ` Patrick McHardy
2014-03-27 21:53 ` [PATCH 7/7] netfilter: nf_tables: move table " Pablo Neira Ayuso
2014-03-28 13:12 ` Patrick McHardy
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=20140328125741.GA13685@localhost \
--to=pablo@netfilter.org \
--cc=kaber@trash.net \
--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).