public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] skbuff: update sk truesize in pskb_expand_head
@ 2011-10-14  7:39 roy.qing.li
  2011-10-14  7:48 ` David Miller
  2011-10-14  7:53 ` Eric Dumazet
  0 siblings, 2 replies; 6+ messages in thread
From: roy.qing.li @ 2011-10-14  7:39 UTC (permalink / raw)
  To: netdev

when pskb_expand_head reallocates header of &sk_buff, the sk
truesize should be updated simultaneously

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
---
 net/core/skbuff.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 387703f..48e0be9 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -920,6 +920,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 	}
 	off = (data + nhead) - skb->head;
 
+	skb->truesize += (size - (skb_end_pointer(skb) - skb->head));
 	skb->head     = data;
 adjust_others:
 	skb->data    += off;
-- 
1.7.1

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

end of thread, other threads:[~2011-10-15  4:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-14  7:39 [PATCH net-next] skbuff: update sk truesize in pskb_expand_head roy.qing.li
2011-10-14  7:48 ` David Miller
2011-10-15  3:52   ` RongQing Li
2011-10-15  4:02     ` David Miller
2011-10-14  7:53 ` Eric Dumazet
2011-10-15  3:54   ` RongQing Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox