[Openswan dev] [PATCH] AH packets offsets incorrect

David McCullough davidm at snapgear.com
Wed Feb 15 10:51:14 CET 2006


Hi dev,

Here is a patch (orginally posted by Ronen Shitrit <rshitrit at marvell.com>)
to fix the packet offsets for AH only processing.

Patch is against 2.4.5rc5,

Cheers,
Davidm

-- 
David McCullough, davidm at cyberguard.com.au, Custom Embedded Solutions + Security
Ph:+61 734352815 Fx:+61 738913630 http://www.uCdot.org http://www.cyberguard.com
-------------- next part --------------
Index: openswan/linux/net/ipsec/ipsec_ah.c
===================================================================
RCS file: openswan/linux/net/ipsec/ipsec_ah.c,v
retrieving revision 1.1.1.2
retrieving revision 1.4
diff -u -r1.1.1.2 -r1.4
--- openswan/linux/net/ipsec/ipsec_ah.c	26 Sep 2005 01:46:23 -0000	1.1.1.2
+++ openswan/linux/net/ipsec/ipsec_ah.c	14 Feb 2006 05:30:50 -0000	1.4
@@ -162,7 +169,7 @@
 	/* finally, do the packet contents themselves */
 	(*aa->update)((void*)&tctx,
 		      (caddr_t)skb->h.raw + ahhlen,
-		      skb->len - irs->iphlen - ahhlen);
+		      skb->len - ahhlen);
 
 	(*aa->final)(irs->hash, (void *)&tctx);
 
@@ -210,6 +217,7 @@
 	}
 	skb_pull(skb, ahhlen);
 
+	skb->nh.raw = skb->nh.raw + ahhlen;
 	irs->ipp = skb->nh.iph;
 
 	ipsec_rcv_dmp("ah postpull", (void *)skb->nh.iph, skb->len);


More information about the Dev mailing list