]> git.itanic.dy.fi Git - linux-stable/commit
netfilter: make nftables drops visible in net dropmonitor
authorFlorian Westphal <fw@strlen.de>
Wed, 11 Oct 2023 07:59:38 +0000 (09:59 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 18 Oct 2023 08:26:43 +0000 (10:26 +0200)
commite0d4593140b01b8da513a0c88c26da28b4906413
tree38aa2be18abfbdb974535a1530910a8b6c25cca2
parent35c038b0a4be197679deefaf96998241cb7efc88
netfilter: make nftables drops visible in net dropmonitor

net_dropmonitor blames core.c:nf_hook_slow.
Add NF_DROP_REASON() helper and use it in nft_do_chain().

The helper releases the skb, so exact drop location becomes
available. Calling code will observe the NF_STOLEN verdict
instead.

Adjust nf_hook_slow so we can embed an erro value wih
NF_STOLEN verdicts, just like we do for NF_DROP.

After this, drop in nftables can be pinpointed to a drop due
to a rule or the chain policy.

Signed-off-by: Florian Westphal <fw@strlen.de>
include/linux/netfilter.h
net/netfilter/core.c
net/netfilter/nf_tables_core.c