[PATCH] IPV6: Fix large packet length check

STALE8510d

3 messages, 3 authors, 2003-06-24 · open the first message on its own page

[PATCH] IPV6: Fix large packet length check

From: YOSHIFUJI Hideaki / 吉藤英明 <hidden>
Date: 2003-06-24 03:40:30

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

Re: [PATCH] IPV6: Fix large packet length check

From: James Morris <hidden>
Date: 2003-06-24 08:47:26

On Tue, 24 Jun 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote:
This patch fixes the problem.
Patch against [PATCH] IPV6: use macro for maximum payload length patch.
I've applied both of these to bk://kernel.bkbits.net/jmorris/net-2.5


- James
-- 
James Morris
[off-list ref]

Re: [PATCH] IPV6: Fix large packet length check

From: David S. Miller <hidden>
Date: 2003-06-24 21:51:51

   From: James Morris [off-list ref]
   Date: Tue, 24 Jun 2003 18:47:26 +1000 (EST)

   On Tue, 24 Jun 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote:
   
   > This patch fixes the problem.
   > Patch against [PATCH] IPV6: use macro for maximum payload length patch.
   
   I've applied both of these to bk://kernel.bkbits.net/jmorris/net-2.5

Thanks James, I've pulled them.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help