Patchwork xen/netfront: do not mark packets of length < MSS as GSO

login
register
mail settings
Submitter Ian Campbell
Date Jan. 13, 2009, 3:30 p.m.
Message ID <1231860655-13182-1-git-send-email-Ian.Campbell@citrix.com>
Download mbox | patch
Permalink /patch/18243/
State Superseded
Delegated to: David Miller
Headers show

Comments

Ian Campbell - Jan. 13, 2009, 3:30 p.m.
Linux assumes that skbs marked for GSO are longer than MSS. In
particular tcp_tso_segment assumes that skb_segment will return a
chain of at least 2 skbs.

Therefore netfront should not pass such a packet up the stack.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: jgarzik@pobox.com
Cc: netdev@vger.kernel.org
---
 drivers/net/xen-netfront.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index cd6184e..3777c09 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -953,6 +953,11 @@  err:
 		else if (rx->flags & NETRXF_data_validated)
 			skb->ip_summed = CHECKSUM_UNNECESSARY;
 
+		if (skb->data_len < skb_shinfo(skb)->gso_size) {
+			skb_shinfo(skb)->gso_size = 0;
+			skb_shinfo(skb)->gso_type = 0;
+		}
+
 		__skb_queue_tail(&rxq, skb);
 
 		np->rx.rsp_cons = ++i;