Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netipsec fix pointer/offset mistakes in handling of IPv4...



details:   https://anonhg.NetBSD.org/src/rev/6a741139760e
branches:  trunk
changeset: 773009:6a741139760e
user:      drochner <drochner%NetBSD.org@localhost>
date:      Tue Jan 24 21:57:03 2012 +0000

description:
fix pointer/offset mistakes in handling of IPv4 options

diffstat:

 sys/netipsec/xform_ah.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 87aae63af82f -r 6a741139760e sys/netipsec/xform_ah.c
--- a/sys/netipsec/xform_ah.c   Tue Jan 24 20:04:07 2012 +0000
+++ b/sys/netipsec/xform_ah.c   Tue Jan 24 21:57:03 2012 +0000
@@ -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 @@
                                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 @@
 
                                /* Zeroize all other options. */
                                count = ptr[off + 1];
-                               memcpy(ptr, ipseczeroes, count);
+                               memcpy(ptr + off, ipseczeroes, count);
                                off += count;
                                break;
                        }



Home | Main Index | Thread Index | Old Index