aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/core.c
diff options
context:
space:
mode:
authorMenglong Dong <imagedong@tencent.com>2022-02-05 15:47:34 +0800
committerDavid S. Miller <davem@davemloft.net>2022-02-07 11:18:49 +0000
commit2df3041ba3be950376e8c25a8f6da22f7fcc765c (patch)
tree2a325cd70314507138627c9ecd7ab01c491322a4 /net/netfilter/core.c
parentnet: skb_drop_reason: add document for drop reasons (diff)
downloadlinux-dev-2df3041ba3be950376e8c25a8f6da22f7fcc765c.tar.xz
linux-dev-2df3041ba3be950376e8c25a8f6da22f7fcc765c.zip
net: netfilter: use kfree_drop_reason() for NF_DROP
Replace kfree_skb() with kfree_skb_reason() in nf_hook_slow() when skb is dropped by reason of NF_DROP. Following new drop reasons are introduced: SKB_DROP_REASON_NETFILTER_DROP Signed-off-by: Menglong Dong <imagedong@tencent.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/core.c')
-rw-r--r--net/netfilter/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/core.c b/net/netfilter/core.c
index 354cb472f386..d1c9dfbb11fa 100644
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
@@ -621,7 +621,8 @@ int nf_hook_slow(struct sk_buff *skb, struct nf_hook_state *state,
case NF_ACCEPT:
break;
case NF_DROP:
- kfree_skb(skb);
+ kfree_skb_reason(skb,
+ SKB_DROP_REASON_NETFILTER_DROP);
ret = NF_DROP_GETERR(verdict);
if (ret == 0)
ret = -EPERM;