From 56a87de33f645d8d511e7c8c373db7c5b1f97084 Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Wed, 17 Oct 2001 13:01:39 +0000 Subject: [PATCH] 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 --- sys/netkey/key.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/netkey/key.c b/sys/netkey/key.c index c3d8954827fb..8cb0355d920f 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);