netfilter: nf_tables: honor NLM_F_CREATE and NLM_F_EXCL in event notification
Subsystems (2)
Pablo Neira Ayuso
maintainerPATCH v2 1/1 netfilter: nf_tables: honor NLM_F_CREATE and NLM_F_EXCL in event notification
Include the NLM_F_CREATE and NLM_F_EXCL flags in netlink event notifications, otherwise userspace cannot distiguish between create and add commands.
Fixes 96518518cc41 ("netfilter: add nftables")
Signed-off-by Pablo Neira Ayuso <[email protected]>
---
v2: save a few LoC.
include/net/netfilter/nf_tables.h | 2 +- net/netfilter/nf_tables_api.c | 47 +++++++++++++++++++++++-------- net/netfilter/nft_quota.c | 2 +- 3 files changed, 37 insertions(+), 14 deletions(-)
include/net/netfilter/nf_tables.h +1 -1
@@ -1202,7 +1202,7 @@ struct nft_object *nft_obj_lookup(const struct net *net,void nft_obj_notify (struct net *net,const struct nft_table *table,struct nft_object *obj,u32 portid,u32 seq, -int event,int family,int report,gfp_t gfp); +int event,u16 flags,int family,int report,gfp_t gfp);/** * struct nft_object_type - stateful object type
net/netfilter/nf_tables_api.c +35 -12
152 lines not on this page · raw message
net/netfilter/nft_quota.c +1 -1
@@ -60,7 +60,7 @@ static void nft_quota_obj_eval(struct nft_object *obj,if (overquota && !test_and_set_bit (NFT_QUOTA_DEPLETED_BIT , &priv->flags))nft_obj_notify (nft_net (pkt), obj->key.table, obj,0 ,0 , -NFT_MSG_NEWOBJ ,nft_pf (pkt),0 ,GFP_ATOMIC ); +NFT_MSG_NEWOBJ ,0 ,nft_pf (pkt),0 ,GFP_ATOMIC ); } static int nft_quota_do_init(const struct nlattr * const tb[],
Signature · 1 line
2.30.2