Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=efd1e8d569b3d35a3a636683c2a9ebffec9c1fcf
Commit:     efd1e8d569b3d35a3a636683c2a9ebffec9c1fcf
Parent:     33036807b32d5ed1f4fdfe2d5e6bab2bb260b9f7
Author:     Patrick McHardy <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 10 18:30:09 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:28:53 2007 -0700

    [SK_BUFF]: Fix missing offset adjustment in skb_copy_expand
    
    skb_copy_expand changes the headroom, so it needs to adjust the header
    offsets by the difference between the old and the new value.
    
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/core/skbuff.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 52a4fdd..c7a1b24 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -736,7 +736,9 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
         */
        struct sk_buff *n = alloc_skb(newheadroom + skb->len + newtailroom,
                                      gfp_mask);
+       int oldheadroom = skb_headroom(skb);
        int head_copy_len, head_copy_off;
+       int off = 0;
 
        if (!n)
                return NULL;
@@ -746,7 +748,7 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
        /* Set the tail pointer and length */
        skb_put(n, skb->len);
 
-       head_copy_len = skb_headroom(skb);
+       head_copy_len = oldheadroom;
        head_copy_off = 0;
        if (newheadroom <= head_copy_len)
                head_copy_len = newheadroom;
@@ -760,6 +762,13 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
 
        copy_skb_header(n, skb);
 
+#ifdef NET_SKBUFF_DATA_USES_OFFSET
+       off                  = newheadroom - oldheadroom;
+#endif
+       n->transport_header += off;
+       n->network_header   += off;
+       n->mac_header       += off;
+
        return n;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to