Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netipsec Omit unnecessary check of sav->state
details: https://anonhg.NetBSD.org/src/rev/4837e4865955
branches: trunk
changeset: 355075:4837e4865955
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Wed Jul 12 07:33:37 2017 +0000
description:
Omit unnecessary check of sav->state
key_allocsa_policy picks a sav of either MATURE or DYING so we
don't need to check its state again.
diffstat:
sys/netipsec/key.c | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diffs (32 lines):
diff -r b9c16c2c11f7 -r 4837e4865955 sys/netipsec/key.c
--- a/sys/netipsec/key.c Wed Jul 12 07:22:31 2017 +0000
+++ b/sys/netipsec/key.c Wed Jul 12 07:33:37 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: key.c,v 1.179 2017/07/12 07:00:40 ozaki-r Exp $ */
+/* $NetBSD: key.c,v 1.180 2017/07/12 07:33:37 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.179 2017/07/12 07:00:40 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.180 2017/07/12 07:33:37 ozaki-r Exp $");
/*
* This code is referd to RFC 2367
@@ -899,12 +899,8 @@
KEY_FREESAV(&oldsav);
/* When there is SA. */
- if (isr->sav != NULL) {
- if (isr->sav->state != SADB_SASTATE_MATURE &&
- isr->sav->state != SADB_SASTATE_DYING)
- return EINVAL;
+ if (isr->sav != NULL)
return 0;
- }
/* there is no SA */
error = key_acquire(saidx, isr->sp);
Home |
Main Index |
Thread Index |
Old Index