]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
commite189ae161dd784aa5d454b0832f818cacc0e131b
tree064fb0aad8ff0703bb3c3f1997dec597ce34e9db
parent339031bafe6b281cf2dcb8364217288b9fdab555
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: 96518518cc41 ("netfilter: add nftables")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c