Re: [PATCH 1/7] netfilter: nf_tables: deconstify table and chain in context structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux