netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IPV6: Fix large packet length check
@ 2003-06-24  3:40 YOSHIFUJI Hideaki / 吉藤英明
  2003-06-24  8:47 ` James Morris
  0 siblings, 1 reply; 3+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2003-06-24  3:40 UTC (permalink / raw)
  To: davem; +Cc: netdev, yoshfuji

Hello.

There were two errors in length check in the output path.
We could not send large packet (65535bytes).

This patch fixes the problem.
Patch against [PATCH] IPV6: use macro for maximum payload length patch.

Thanks.

--- linux-2.5+advmss+magic/net/ipv6/ip6_output.c.orig	Tue Jun 24 12:34:12 2003
+++ linux-2.5+advmss+magic/net/ipv6/ip6_output.c	Tue Jun 24 12:32:34 2003
@@ -1265,7 +1265,7 @@
 	maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen - sizeof(struct frag_hdr);
 
 	if (mtu <= sizeof(struct ipv6hdr) + IPV6_MAXPLEN) {
-		if (inet->cork.length + length > IPV6_MAXPLEN - fragheaderlen) {
+		if (inet->cork.length + length > sizeof(struct ipv6hdr) + IPV6_MAXPLEN - fragheaderlen) {
 			ipv6_local_error(sk, EMSGSIZE, fl, mtu-exthdrlen);
 			return -EMSGSIZE;
 		}
@@ -1461,7 +1461,7 @@
 	
 	*(u32*)hdr = fl->fl6_flowlabel | htonl(0x60000000);
 
-	if (skb->len <= IPV6_MAXPLEN)
+	if (skb->len <= sizeof(struct ipv6hdr) + IPV6_MAXPLEN)
 		hdr->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
 	else
 		hdr->payload_len = 0;

-- 
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

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

end of thread, other threads:[~2003-06-24 21:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-24  3:40 [PATCH] IPV6: Fix large packet length check YOSHIFUJI Hideaki / 吉藤英明
2003-06-24  8:47 ` James Morris
2003-06-24 21:51   ` David S. Miller

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