netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/T] [NET] make pskb_expand_head warn when called with invalid state
@ 2008-05-04 18:16 Johannes Berg
  2008-05-05 15:40 ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2008-05-04 18:16 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Herbert Xu

This makes pskb_expand_head warn when called when a socket is attached.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
Based on a different patch by davem.

Will also trigger with mac80211.

 net/core/skbuff.c |    2 ++
 1 file changed, 2 insertions(+)

--- everything.orig/net/core/skbuff.c	2008-05-04 01:18:49.000000000 +0200
+++ everything/net/core/skbuff.c	2008-05-04 01:23:50.000000000 +0200
@@ -689,6 +689,8 @@ int pskb_expand_head(struct sk_buff *skb
 	if (!data)
 		goto nodata;
 
+	WARN_ON((nhead || ntail) && skb->sk);
+
 	/* Copy only real data... and, alas, header. This should be
 	 * optimized for the cases when header is void. */
 #ifdef NET_SKBUFF_DATA_USES_OFFSET



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-05-13  8:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-04 18:16 [RFC/T] [NET] make pskb_expand_head warn when called with invalid state Johannes Berg
2008-05-05 15:40 ` Johannes Berg
2008-05-05 16:01   ` Johannes Berg
2008-05-13  5:15     ` David Miller
2008-05-13  8:32       ` Johannes Berg
2008-05-13  8:38         ` David Miller
2008-05-13  5:11   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).