Subject: [SK_BUFF]: Fix missing offset adjustment in pskb_expand_head

From: Patrick McHardy <[email-masked]>
Date: Sun, 08 Apr 2007 03:47:39 +0200

These patches fix two crashes I was getting with net-2.6.22
on 64 bit caused by missing skb header offset adjustments
when changing the headroom length.

[SK_BUFF]: Fix missing offset adjustment in pskb_expand_head

Since we're increasing the headroom, the header offsets need to be
increased by the same amount as well.

Signed-off-by: Patrick McHardy <[email-masked]>

---
commit fb98b03719ad23840ca005edbba3c86ef1e3282c
tree 25821494e6032e487f3d197fa1392206b0004583
parent 5899a39783bd49bd6b926eaeafc16c7276620f63
author Patrick McHardy <[email-masked]> Sun, 08 Apr 2007 03:17:49 +0200
committer Patrick McHardy <[email-masked]> Sun, 08 Apr 2007 03:17:49 +0200

 net/core/skbuff.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index e60864e..5c9ee94 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -725,14 +725,15 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 	skb->data    += off;
 #ifdef NET_SKBUFF_DATA_USES_OFFSET
 	skb->end      = size;
+	off           = nhead;
 #else
 	skb->end      = skb->head + size;
+#endif
 	/* {transport,network,mac}_header and tail are relative to skb->head */
 	skb->tail	      += off;
 	skb->transport_header += off;
 	skb->network_header   += off;
 	skb->mac_header	      += off;
-#endif
 	skb->cloned   = 0;
 	skb->nohdr    = 0;
 	atomic_set(&skb_shinfo(skb)->dataref, 1);