From: Flavio Leitner <fleitner@redhat.com>
To: netdev <netdev@vger.kernel.org>
Cc: Flavio Leitner <fleitner@redhat.com>
Subject: [PATCH] net: reset gso header when the copied skb is linearized
Date: Mon, 25 Oct 2010 20:23:18 -0200 [thread overview]
Message-ID: <1288045398-3110-1-git-send-email-fleitner@redhat.com> (raw)
The gso header is incorrect when the copied skb is
linearized. This patch creates another helper function
to copy the gso header when it is appropriated
Signed-off-by: Flavio Leitner <fleitner@redhat.com>
---
net/core/skbuff.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 104f844..54a2d3a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -649,6 +649,12 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
if (skb_mac_header_was_set(new))
new->mac_header += offset;
#endif
+}
+
+static void copy_skb_header_gso(struct sk_buff *new, const struct sk_buff *old)
+{
+ copy_skb_header(new, old);
+
skb_shinfo(new)->gso_size = skb_shinfo(old)->gso_size;
skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs;
skb_shinfo(new)->gso_type = skb_shinfo(old)->gso_type;
@@ -740,7 +746,7 @@ struct sk_buff *pskb_copy(struct sk_buff *skb, gfp_t gfp_mask)
skb_clone_fraglist(n);
}
- copy_skb_header(n, skb);
+ copy_skb_header_gso(n, skb);
out:
return n;
}
--
1.7.3.1
next reply other threads:[~2010-10-25 22:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-25 22:23 Flavio Leitner [this message]
2010-10-26 18:31 ` [PATCH] net: reset gso header when the copied skb is linearized David Miller
2010-10-26 19:25 ` Flavio Leitner
2010-10-26 19:28 ` David Miller
2010-10-26 19:38 ` Herbert Xu
2010-11-04 20:35 ` Flavio Leitner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1288045398-3110-1-git-send-email-fleitner@redhat.com \
--to=fleitner@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.