summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2026-05-11 10:23:08 +0300
committerJakub Kicinski <kuba@kernel.org>2026-05-13 04:31:11 +0300
commit5c4b709b5fc1929ed3e9d3ef48c089d7df8b8dff (patch)
treedfe29d17509953ac30db49fd9dcc3602afa30f1d /include
parentb588019e85f490696bf19f0747e93f14b1563927 (diff)
downloadlinux-5c4b709b5fc1929ed3e9d3ef48c089d7df8b8dff.tar.xz
net: constify sk_skb_reason_drop() sock parameter
sk_skb_reason_drop() does not change sock parameter, make it const so that we can call it from TCP stack without a cast on a (const) listener socket. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: David Ahern <dsahern@kernel.org> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20260511072310.1094859-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/skbuff.h3
-rw-r--r--include/trace/events/skb.h4
2 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 2bcf78a4de7b..746e741a8ef9 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1313,7 +1313,8 @@ static inline bool skb_data_unref(const struct sk_buff *skb,
return true;
}
-void __fix_address sk_skb_reason_drop(struct sock *sk, struct sk_buff *skb,
+void __fix_address sk_skb_reason_drop(const struct sock *sk,
+ struct sk_buff *skb,
enum skb_drop_reason reason);
static inline void
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index b877133cd93a..2945aa7fe9a7 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -24,14 +24,14 @@ DEFINE_DROP_REASON(FN, FN)
TRACE_EVENT(kfree_skb,
TP_PROTO(struct sk_buff *skb, void *location,
- enum skb_drop_reason reason, struct sock *rx_sk),
+ enum skb_drop_reason reason, const struct sock *rx_sk),
TP_ARGS(skb, location, reason, rx_sk),
TP_STRUCT__entry(
__field(void *, skbaddr)
__field(void *, location)
- __field(void *, rx_sk)
+ __field(const void *, rx_sk)
__field(unsigned short, protocol)
__field(enum skb_drop_reason, reason)
),