netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: reset gso header when the copied skb is linearized
@ 2010-10-25 22:23 Flavio Leitner
  2010-10-26 18:31 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Flavio Leitner @ 2010-10-25 22:23 UTC (permalink / raw)
  To: netdev; +Cc: Flavio Leitner

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


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

end of thread, other threads:[~2010-11-04 20:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-25 22:23 [PATCH] net: reset gso header when the copied skb is linearized Flavio Leitner
2010-10-26 18:31 ` 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

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).