Re: skb_segment() questions

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Herbert Xu
Date: Saturday, March 28, 2009 - 7:07 pm

On Wed, Mar 04, 2009 at 07:12:40PM -0800, James Huang wrote:

Indeed.  This breaks linear packets, which unfortunately older
versions of tun likes to construct.

gso: Fix support for linear packets

When GRO/frag_list support was added to GSO, I made an error
which broke the support for segmenting linear GSO packets (GSO
packets are normally non-linear in the payload).

These days most of these packets are constructed by the tun
driver, which prefers to allocate linear memory if possible.
This is fixed in the latest kernel, but for 2.6.29 and earlier
it is still the norm.

Therefore this bug causes failures with GSO when used with tun
in 2.6.29.

Reported-by: James Huang <jamesclhuang@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 6acbf9e..ce6356c 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2579,7 +2579,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
 					  skb_network_header_len(skb));
 		skb_copy_from_linear_data(skb, nskb->data, doffset);
 
-		if (pos >= offset + len)
+		if (fskb != skb_shinfo(skb)->frag_list)
 			continue;
 
 		if (!sg) {

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: skb_segment() questions, Herbert Xu, (Sat Mar 28, 7:07 pm)
Re: skb_segment() questions, David Miller, (Sat Mar 28, 11:39 pm)
Re: skb_segment() questions, Mark McLoughlin, (Mon Mar 30, 1:50 am)
Re: skb_segment() questions, David Miller, (Mon Mar 30, 1:57 pm)
[PATCH] Re: skb_segment() questions, Jarek Poplawski, (Wed Apr 1, 2:18 am)
Re: [PATCH] Re: skb_segment() questions, Herbert Xu, (Wed Apr 1, 2:24 am)
Re: [PATCH] Re: skb_segment() questions, Jarek Poplawski, (Wed Apr 1, 2:50 am)
Re: [PATCH] Re: skb_segment() questions, Herbert Xu, (Wed Apr 1, 2:53 am)
Re: [PATCH] Re: skb_segment() questions, Jarek Poplawski, (Wed Apr 1, 3:02 am)
Re: skb_segment() questions, Mark McLoughlin, (Mon Apr 20, 4:12 am)
Re: skb_segment() questions, David Miller, (Mon Apr 20, 4:57 am)