summaryrefslogtreecommitdiffstats
path: root/sys/netkey/key.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2001-10-17 13:01:39 +0000
committerume <ume@FreeBSD.org>2001-10-17 13:01:39 +0000
commitb44023b126535b8854d9ccdc4d6969ed312fb1f8 (patch)
treeebcb7038097e7f61eee5cb2ca3173ce4260fc292 /sys/netkey/key.c
parent3897ad5e6e77754bf14bd09db9271dc4dc20cd4d (diff)
downloadFreeBSD-src-b44023b126535b8854d9ccdc4d6969ed312fb1f8.zip
FreeBSD-src-b44023b126535b8854d9ccdc4d6969ed312fb1f8.tar.gz
The behavior of SPDUPDATE has been changed.
SPDUPDATE doesn't depend on whether there is a SP or not. This change makes `generate_policy on' of racoon work. Obtained from: KAME MFC after: 1 week
Diffstat (limited to 'sys/netkey/key.c')
-rw-r--r--sys/netkey/key.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/netkey/key.c b/sys/netkey/key.c
index c3d8954..8cb0355 100644
--- a/sys/netkey/key.c
+++ b/sys/netkey/key.c
@@ -1724,20 +1724,16 @@ key_spdadd(so, m, mhp)
/*
* checking there is SP already or not.
- * If type is SPDUPDATE and no SP found, then error.
- * If type is either SPDADD or SPDSETIDX and SP found, then error.
+ * SPDUPDATE doesn't depend on whether there is a SP or not.
+ * If the type is either SPDADD or SPDSETIDX AND a SP is found,
+ * then error.
*/
newsp = key_getsp(&spidx);
if (mhp->msg->sadb_msg_type == SADB_X_SPDUPDATE) {
- if (newsp == NULL) {
-#ifdef IPSEC_DEBUG
- printf("key_spdadd: no SP found.\n");
-#endif
- return key_senderror(so, m, ENOENT);
+ if (newsp) {
+ newsp->state = IPSEC_SPSTATE_DEAD;
+ key_freesp(newsp);
}
-
- newsp->state = IPSEC_SPSTATE_DEAD;
- key_freesp(newsp);
} else {
if (newsp != NULL) {
key_freesp(newsp);
OpenPOWER on IntegriCloud