Source-Changes-HG archive

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

[src/trunk]: src/sys/netipsec Remove unnecessary zero-clearing codes from key...



details:   https://anonhg.NetBSD.org/src/rev/d3fcb7108624
branches:  trunk
changeset: 825341:d3fcb7108624
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Jul 10 07:46:02 2017 +0000

description:
Remove unnecessary zero-clearing codes from key_setsaval

key_setsaval is now used only for a newly-allocated sav. (It was
used to reset variables of an existing sav.)

diffstat:

 sys/netipsec/key.c |  13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)

diffs (34 lines):

diff -r c5759b806b47 -r d3fcb7108624 sys/netipsec/key.c
--- a/sys/netipsec/key.c        Mon Jul 10 07:45:10 2017 +0000
+++ b/sys/netipsec/key.c        Mon Jul 10 07:46:02 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: key.c,v 1.171 2017/07/10 07:45:10 ozaki-r Exp $        */
+/*     $NetBSD: key.c,v 1.172 2017/07/10 07:46:02 ozaki-r Exp $        */
 /*     $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $        */
 /*     $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $   */
 
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.171 2017/07/10 07:45:10 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.172 2017/07/10 07:46:02 ozaki-r Exp $");
 
 /*
  * This code is referd to RFC 2367
@@ -3154,15 +3154,6 @@
        /* We shouldn't initialize sav variables while someone uses it. */
        KASSERT(sav->refcnt == 0);
 
-       /* initialization */
-       key_freesaval(sav);
-       sav->tdb_xform = NULL;          /* transform */
-       sav->tdb_encalgxform = NULL;    /* encoding algorithm */
-       sav->tdb_authalgxform = NULL;   /* authentication algorithm */
-       sav->tdb_compalgxform = NULL;   /* compression algorithm */
-       sav->natt_type = 0;
-       sav->esp_frag = 0;
-
        /* SA */
        if (mhp->ext[SADB_EXT_SA] != NULL) {
                const struct sadb_sa *sa0;



Home | Main Index | Thread Index | Old Index