Skip to content

Commit 6f03bf4

Browse files
committed
netfilter: nf_tables: add NFTA_SET_USERDATA if not null
Kernel sends an empty NFTA_SET_USERDATA attribute with no value if userspace adds a set with no NFTA_SET_USERDATA attribute. Fixes: e6d8eca ("netfilter: nf_tables: Add new attributes into nft_set to store user data.") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 0726763 commit 6f03bf4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎net/netfilter/nf_tables_api.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3770,7 +3770,8 @@ static int nf_tables_fill_set(struct sk_buff *skb, const struct nft_ctx *ctx,
37703770
goto nla_put_failure;
37713771
}
37723772

3773-
if (nla_put(skb, NFTA_SET_USERDATA, set->udlen, set->udata))
3773+
if (set->udata &&
3774+
nla_put(skb, NFTA_SET_USERDATA, set->udlen, set->udata))
37743775
goto nla_put_failure;
37753776

37763777
nest = nla_nest_start_noflag(skb, NFTA_SET_DESC);

0 commit comments

Comments
 (0)