On 10/18/2019 6:24 PM, Florian Westphal wrote:
> we...@ucloud.cn <we...@ucloud.cn> wrote:
>> From: wenxu <we...@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.
It can add vlan tci / proto "get" expr and It also can support offload things
in the future.
>> +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;
Will do.
>
> Other than that this looks good to me.
>