All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: wenxu@ucloud.cn
Cc: pablo@netfilter.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next] netfilter: nf_tables: add vlan support
Date: Fri, 18 Oct 2019 12:24:02 +0200	[thread overview]
Message-ID: <20191018102402.GY25052@breakpoint.cc> (raw)
In-Reply-To: <1571392968-1263-1-git-send-email-wenxu@ucloud.cn>

wenxu@ucloud.cn <wenxu@ucloud.cn> wrote:
> From: wenxu <wenxu@ucloud.cn>
> 
> This patch implements the vlan expr type that can be used to
> configure vlan tci and vlan proto

Looks like a very small module with no external dependencies,
I think you could make this a nft-builtin feature and just add
nft_vlan.o to 'nf_tables-objs' in net/netfilter/Makefile, similar to
nft_rt.

What do you think?

If you plan to extend this in the future then I'm fine with keeping it
as a module.

> +static int nft_vlan_set_init(const struct nft_ctx *ctx,
> +			     const struct nft_expr *expr,
> +			     const struct nlattr * const tb[])
> +{
> +	struct nft_vlan *priv = nft_expr_priv(expr);
> +	int err;

I think you need to add

	if (!tb[NFTA_VLAN_ACTION] ||
	    !tb[NFTA_VLAN_SREG] ||
	    !tb[NFTA_VLAN_SREG2])
		return -EINVAL;

Other than that this looks good to me.

  reply	other threads:[~2019-10-18 10:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 10:02 [PATCH nf-next] netfilter: nf_tables: add vlan support wenxu
2019-10-18 10:24 ` Florian Westphal [this message]
2019-10-18 10:40   ` wenxu
2019-10-18 10:51     ` Florian Westphal

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=20191018102402.GY25052@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=wenxu@ucloud.cn \
    /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.