[PATCH] IPv6: Fix Length of Authentication Extension Header

STALE8611d

2 messages, 2 authors, 2003-01-06 · open the first message on its own page

[PATCH] IPv6: Fix Length of Authentication Extension Header

From: YOSHIFUJI Hideaki / 吉藤英明 <hidden>
Date: 2003-01-04 17:40:44

Hello!

This patch fixes calculation of length of IPv6 Authentication Extension
Header.

RFC2402: 2.2 Payload Length
:
This 8-bit field specifies the length of AH in 32-bit words (4-byte
units), minus "2".  ...

This is against linux-2.4.20, 2.5.54. 
(2.2.x series have similar bug, too.)

Thanks in advance.

-------------------------------------------------------------------
Patch-Name: Fix Length of Authentication Extension Header
Patch-Id: FIX_2_4_20_EXTHDRS_AUTHHDRLEN-20030105
Patch-Author: YOSHIFUJI Hideaki / USAGI Project [off-list ref]
Credit: Noriaki Takamiya / USAGI Project [off-list ref]
Reference: RFC2402
-------------------------------------------------------------------
Index: net/ipv6/exthdrs.c
===================================================================
RCS file: /cvsroot/usagi/usagi-backport/linux24/net/ipv6/exthdrs.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.46.1
diff -u -r1.1.1.1 -r1.1.1.1.46.1
--- net/ipv6/exthdrs.c	20 Aug 2002 09:47:02 -0000	1.1.1.1
+++ net/ipv6/exthdrs.c	4 Jan 2003 17:19:03 -0000	1.1.1.1.46.1
@@ -402,7 +402,13 @@
 	if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8))
 		goto fail;
 
-	len = (skb->h.raw[1]+1)<<2;
+	/*
+	 * RFC2402 2.2 Payload Length
+	 * The 8-bit field specifies the length of AH in 32-bit words 
+	 * (4-byte units), minus "2".
+	 * -- Noriaki Takamiya @USAGI Project
+	 */
+	len = (skb->h.raw[1]+2)<<2;
 
 	if (len&7)
 		goto fail;
-- 
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

Re: [PATCH] IPv6: Fix Length of Authentication Extension Header

From: David S. Miller <hidden>
Date: 2003-01-06 06:58:01

Patch applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help