All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Cc: pablo@netfilter.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 2/3] netfilter: nft_meta: split nft_meta_init() into two functions for get/set
Date: Wed, 2 Apr 2014 13:43:19 +0200	[thread overview]
Message-ID: <20140402114319.GC26035@macbook.localnet> (raw)
In-Reply-To: <53396197.20809@linux.intel.com>

On Mon, Mar 31, 2014 at 03:37:43PM +0300, Tomasz Bursztyka wrote:
> Hi Patrick,
> 
> >diff --git a/net/netfilter/nft_meta.c b/net/netfilter/nft_meta.c
> >index 425cf39..6d0b8cc2 100644
> >--- a/net/netfilter/nft_meta.c
> >+++ b/net/netfilter/nft_meta.c
> >@@ -170,21 +170,15 @@ static const struct nla_policy nft_meta_policy[NFTA_META_MAX + 1] = {
> >  	[NFTA_META_SREG]	= { .type = NLA_U32 },
> >  };
> >-static int nft_meta_init_validate_set(uint32_t key)
> >+static int nft_meta_get_init(const struct nft_ctx *ctx,
> >+			     const struct nft_expr *expr,
> >+			     const struct nlattr * const tb[])
> >  {
> >-	switch (key) {
> >-	case NFT_META_MARK:
> >-	case NFT_META_PRIORITY:
> >-	case NFT_META_NFTRACE:
> >-		return 0;
> >-	default:
> >-		return -EOPNOTSUPP;
> >-	}
> >-}
> >+	struct nft_meta *priv = nft_expr_priv(expr);
> >+	int err;
> >-static int nft_meta_init_validate_get(uint32_t key)
> >-{
> >-	switch (key) {
> 
> With the disappearance of nft_meta_init_validate_get(), I will need to add
> an #ifdef/#endif clause for bridge key support. Or I would copy and adapt
> this new nft_meta_get_init() in nft_meta_bridge.c.
> 
> Don't you think nft_meta_validate_get() could be kept?

Why don't you add a bridge specific init function and invoke
nft_meta_get_init() for unknown keys?

It could be kept by passing a unsigned int *size for returning the size
of the key, but I would prefer to solve this differently.

  reply	other threads:[~2014-04-02 11:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-29 10:43 [PATCH 0/3] netfilter: nf_tables: cleanup and a bugfix Patrick McHardy
2014-03-29 10:43 ` [PATCH 1/3] netfilter: nft_ct: add missing ifdef for NFT_MARK setting Patrick McHardy
2014-03-29 10:43 ` [PATCH 2/3] netfilter: nft_meta: split nft_meta_init() into two functions for get/set Patrick McHardy
2014-03-31 12:37   ` Tomasz Bursztyka
2014-04-02 11:43     ` Patrick McHardy [this message]
2014-03-29 10:43 ` [PATCH 3/3] netfilter: nft_ct: split nft_ct_init() " Patrick McHardy
2014-03-30 11:35 ` [PATCH 0/3] netfilter: nf_tables: cleanup and a bugfix 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=20140402114319.GC26035@macbook.localnet \
    --to=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=tomasz.bursztyka@linux.intel.com \
    /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.