netfilter: nf_tables: add NFTA_SET_USERDATA if not null
Subsystems (2)
Pablo Neira Ayuso
maintainerPATCH 1/2 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 no NFTA_SET_USERDATA attribute.
Fixes e6d8ecac9e68 ("netfilter: nf_tables: Add new attributes into nft_set to store user data.")
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- net/netfilter/nf_tables_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nf_tables_api.c +2 -1
@@ -3770,7 +3770,8 @@ static int nf_tables_fill_set(struct sk_buff *skb, const struct nft_ctx *ctx, goto nla_put_failure; } -if (nla_put (skb,NFTA_SET_USERDATA , set->udlen, set->udata)) +if (set->udata && +nla_put (skb,NFTA_SET_USERDATA , set->udlen, set->udata)) goto nla_put_failure; nest =nla_nest_start_noflag (skb,NFTA_SET_DESC );
Signature · 1 line
2.20.1
Pablo Neira Ayuso
maintainerPATCH 2/2 netfilter: nf_tables: incorrect enum nft_list_attributes definition
This should be NFTA_LIST_UNSPEC instead of NFTA_LIST_UNPEC, all other similar attribute definitions are postfixed with _UNSPEC.
Fixes 96518518cc41 ("netfilter: add nftables")
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- include/uapi/linux/netfilter/nf_tables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/netfilter/nf_tables.h +1 -1
@@ -133,7 +133,7 @@ enum nf_tables_msg_types {* @NFTA_LIST_ELEM: list element (NLA_NESTED) */ enum nft_list_attributes { -NFTA_LIST_UNPEC , +NFTA_LIST_UNSPEC ,NFTA_LIST_ELEM , __NFTA_LIST_MAX };
Signature · 1 line
2.20.1