diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2001-10-17 13:01:39 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2001-10-17 13:01:39 +0000 |
commit | 56a87de33f645d8d511e7c8c373db7c5b1f97084 (patch) | |
tree | ebcb7038097e7f61eee5cb2ca3173ce4260fc292 /sys/netkey/key.c | |
parent | 28070a0efeb3ab2a9a222c5fa7913333c385dd8c (diff) | |
download | src-56a87de33f645d8d511e7c8c373db7c5b1f97084.tar.gz src-56a87de33f645d8d511e7c8c373db7c5b1f97084.zip |
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
Notes
Notes:
svn path=/head/; revision=85054
Diffstat (limited to 'sys/netkey/key.c')
-rw-r--r-- | sys/netkey/key.c | 16 |
1 files 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); |