Source-Changes-HG archive

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

[src/trunk]: src/sys/netipsec Constify ipseczeroes, and remove one use of it.



details:   https://anonhg.NetBSD.org/src/rev/80ee58b6a95c
branches:  trunk
changeset: 362205:80ee58b6a95c
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu May 31 06:25:41 2018 +0000

description:
Constify ipseczeroes, and remove one use of it.

diffstat:

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

diffs (36 lines):

diff -r a4fee49469a0 -r 80ee58b6a95c sys/netipsec/xform_ah.c
--- a/sys/netipsec/xform_ah.c   Thu May 31 06:14:18 2018 +0000
+++ b/sys/netipsec/xform_ah.c   Thu May 31 06:25:41 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform_ah.c,v 1.105 2018/05/30 18:02:40 maxv Exp $      */
+/*     $NetBSD: xform_ah.c,v 1.106 2018/05/31 06:25:41 maxv Exp $      */
 /*     $FreeBSD: 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.105 2018/05/30 18:02:40 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.106 2018/05/31 06:25:41 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -104,7 +104,7 @@
 int ah_enable = 1;                     /* control flow of packets with AH */
 int ip4_ah_cleartos = 1;               /* clear ip_tos when doing AH calc */
 
-static unsigned char ipseczeroes[256]; /* larger than an ip6 extension hdr */
+static const char ipseczeroes[256];
 
 int ah_max_authsize;                   /* max authsize over all algorithms */
 
@@ -375,7 +375,7 @@
 
                        default:
                                /* Zeroize all other options. */
-                               memcpy(ptr + off, ipseczeroes, optlen);
+                               memset(ptr + off, 0, optlen);
                                break;
                        }
 



Home | Main Index | Thread Index | Old Index