Patchwork [net-next] myri10ge: check fragmentation in LRO get_frag_header()

login
register
mail settings
Submitter Brice Goglin
Date Dec. 8, 2008, 9:17 a.m.
Message ID <493CE630.3010809@myri.com>
Download mbox | patch
Permalink /patch/12693/
State Accepted
Delegated to: David Miller
Headers show

Comments

Brice Goglin - Dec. 8, 2008, 9:17 a.m.
Add a fragmentation check to myri10ge's LRO get_frag_header() callback.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com> 



--
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
David Miller - Dec. 9, 2008, 8:14 a.m.
From: Brice Goglin <brice@myri.com>
Date: Mon, 08 Dec 2008 10:17:36 +0100

> Add a fragmentation check to myri10ge's LRO get_frag_header() callback.
> 
> Signed-off-by: Brice Goglin <brice@myri.com>
> Signed-off-by: Andrew Gallatin <gallatin@myri.com> 

Applied, thanks Brice.
--
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

Patch

--- linux-git/drivers/net/myri10ge/myri10ge.c	2008-12-08 10:12:11.000000000 +0100
+++ linux-tmp/drivers/net/myri10ge/myri10ge.c	2008-12-08 10:12:21.000000000 +0100
@@ -2229,6 +2229,8 @@  myri10ge_get_frag_header(struct skb_frag
 	*ip_hdr = iph;
 	if (iph->protocol != IPPROTO_TCP)
 		return -1;
+	if (iph->frag_off & htons(IP_MF | IP_OFFSET))
+		return -1;
 	*hdr_flags |= LRO_TCP;
 	*tcpudp_hdr = (u8 *) (*ip_hdr) + (iph->ihl << 2);