Module Name: src
Committed By: drochner
Date: Tue Jan 24 21:57:03 UTC 2012
Modified Files:
src/sys/netipsec: xform_ah.c
Log Message:
fix pointer/offset mistakes in handling of IPv4 options
To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/netipsec/xform_ah.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netipsec/xform_ah.c
diff -u src/sys/netipsec/xform_ah.c:1.34 src/sys/netipsec/xform_ah.c:1.35
--- src/sys/netipsec/xform_ah.c:1.34 Tue Jan 10 20:01:57 2012
+++ src/sys/netipsec/xform_ah.c Tue Jan 24 21:57:03 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: xform_ah.c,v 1.34 2012/01/10 20:01:57 drochner Exp $ */
+/* $NetBSD: xform_ah.c,v 1.35 2012/01/24 21:57:03 drochner Exp $ */
/* $FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
/* $OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
/*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.34 2012/01/10 20:01:57 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.35 2012/01/24 21:57:03 drochner Exp $");
#include "opt_inet.h"
#ifdef __FreeBSD__
@@ -346,7 +346,7 @@ ah_massage_headers(struct mbuf **m0, int
ip->ip_off = 0;
}
- ptr = mtod(m, unsigned char *) + sizeof(struct ip);
+ ptr = mtod(m, unsigned char *);
/* IPv4 option processing */
for (off = sizeof(struct ip); off < skip;) {
@@ -428,7 +428,7 @@ ah_massage_headers(struct mbuf **m0, int
/* Zeroize all other options. */
count = ptr[off + 1];
- memcpy(ptr, ipseczeroes, count);
+ memcpy(ptr + off, ipseczeroes, count);
off += count;
break;
}