From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kunihiro Ishiguro Subject: IPv6 auth header length calculation patch Date: Sat, 04 Jan 2003 08:03:45 -0800 Sender: netdev-bounce@oss.sgi.com Message-ID: <873co8dhr2.wl@ipinfusion.com> Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: multipart/mixed; boundary="Multipart_Sat_Jan__4_08:03:45_2003-1" Cc: yoshfuji@linux-ipv6.org Return-path: To: netdev@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com List-Id: netdev.vger.kernel.org --Multipart_Sat_Jan__4_08:03:45_2003-1 Content-Type: text/plain; charset=US-ASCII This is a USAGI patch to fix IPv6 auth header length calculation. (I'm not USAGI member. I'm working on IPv6 IPsec based on 2.5 code base). RFC2402 2.2 Payload Length : This 8-bit field specifies the length of AH in 32-bit words (4-byte units), minus "2". (All IPv6 extension headers, as per RFC 1883, encode the "Hdr Ext Len" field by first subtracting 1 (64-bit word) from the header length (measured in 64-bit words). AH is an IPv6 extension header. However, since its length is measured in 32-bit words, the "Payload Length" is calculated by subtracting 2 (32 bit words).) In the "standard" case of a 96-bit authentication value Would you mind to apply this to avoid wrong header length calculation? --Multipart_Sat_Jan__4_08:03:45_2003-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="ipv6-auth-hdr-length.diff" Content-Transfer-Encoding: 7bit --- exthdrs.c.orig 2003-01-04 07:59:31.000000000 -0800 +++ exthdrs.c 2003-01-04 07:59:41.000000000 -0800 @@ -402,7 +402,7 @@ if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8)) goto fail; - len = (skb->h.raw[1]+1)<<2; + len = (skb->h.raw[1]+2)<<2; if (len&7) goto fail; --Multipart_Sat_Jan__4_08:03:45_2003-1--