]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: add position handle in event notification
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 20 Sep 2021 22:37:03 +0000 (00:37 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 28 Sep 2021 11:04:56 +0000 (13:04 +0200)
commitd4b5dedc22991e3ea32b3698e1aa2d5fa42db34b
tree064fb0aad8ff0703bb3c3f1997dec597ce34e9db
parenta04d4cf3f213cdc408b65b9881eb3abe45b2ad1d
netfilter: nf_tables: add position handle in event notification

Add position handle to allow to identify the rule location from netlink
events. Otherwise, userspace cannot incrementally update a userspace
cache through monitoring events.

Skip handle dump if the rule has been either inserted (at the beginning
of the ruleset) or appended (at the end of the ruleset), the
NLM_F_APPEND netlink flag is sufficient in these two cases.

Handle NLM_F_REPLACE as NLM_F_APPEND since the rule replacement
expansion appends it after the specified rule handle.

Fixes: 4a4835e91e03 ("netfilter: add nftables")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c