Thread (2 messages) 2 messages, 2 authors, 8h ago
HOTtoday

[PATCH] net: skbuff: Fix misleading comments for skb_put() and skb_push()

From: Ziran Zhang <hidden>
Date: 2026-07-24 15:08:30
Also in: lkml
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Both functions only move the tail/data pointer, they do not copy data.
Update the function descriptions and @len parameter, so they can accurately
reflect the semantics.

Signed-off-by: Ziran Zhang <redacted>
---
 net/core/skbuff.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 18dabb4e9..35ad782ad 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2614,9 +2614,9 @@ void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len)
 EXPORT_SYMBOL_GPL(pskb_put);
 
 /**
- *	skb_put - add data to a buffer
+ *	skb_put - extend the data area at the tail of a buffer
  *	@skb: buffer to use
- *	@len: amount of data to add
+ *	@len: number of bytes to extend
  *
  *	This function extends the used data area of the buffer. If this would
  *	exceed the total buffer size the kernel will panic. A pointer to the
@@ -2635,9 +2635,9 @@ void *skb_put(struct sk_buff *skb, unsigned int len)
 EXPORT_SYMBOL(skb_put);
 
 /**
- *	skb_push - add data to the start of a buffer
+ *	skb_push - extend the data area at the start of a buffer
  *	@skb: buffer to use
- *	@len: amount of data to add
+ *	@len: number of bytes to extend
  *
  *	This function extends the used data area of the buffer at the buffer
  *	start. If this would exceed the total buffer headroom the kernel will
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help