summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2026-04-09 14:56:22 +0000
committerJakub Kicinski <kuba@kernel.org>2026-04-12 14:30:25 -0700
commitc78bcbd51976f123909e5c2baf8cebb699453c2f (patch)
treec692db5a1fec53a26fc186187714a00322c0e2be /include/linux
parent734ea7e324ad1cee2a21f909f756b5e2d903a224 (diff)
net: change sk_filter_reason() to return the reason by value
sk_filter_trim_cap will soon return the reason by value, do the same for sk_filter_reason(). $ scripts/bloat-o-meter -t vmlinux.old vmlinux.new add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-21 (-21) Function old new delta sock_queue_rcv_skb_reason 128 126 -2 tun_net_xmit 1146 1127 -19 Total: Before=29722661, After=29722640, chg -0.00% Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20260409145625.2306224-4-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/filter.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 44d7ae95ddbc..59931e5810b4 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -1102,10 +1102,13 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
return sk_filter_trim_cap(sk, skb, 1, &ignore_reason);
}
-static inline int sk_filter_reason(struct sock *sk, struct sk_buff *skb,
- enum skb_drop_reason *reason)
+static inline enum skb_drop_reason
+sk_filter_reason(struct sock *sk, struct sk_buff *skb)
{
- return sk_filter_trim_cap(sk, skb, 1, reason);
+ enum skb_drop_reason drop_reason;
+
+ sk_filter_trim_cap(sk, skb, 1, &drop_reason);
+ return drop_reason;
}
struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err);