should return error code from key_senderror(). sync w/kame

This commit is contained in:
itojun 2002-08-20 08:17:02 +00:00
parent 8efcaddaf6
commit 88122ef746

View File

@ -1,4 +1,4 @@
/* $NetBSD: key.c,v 1.73 2002/08/20 06:20:26 itojun Exp $ */ /* $NetBSD: key.c,v 1.74 2002/08/20 08:17:02 itojun Exp $ */
/* $KAME: key.c,v 1.249 2002/06/14 14:46:22 itojun Exp $ */ /* $KAME: key.c,v 1.249 2002/06/14 14:46:22 itojun Exp $ */
/* /*
@ -35,7 +35,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.73 2002/08/20 06:20:26 itojun Exp $"); __KERNEL_RCSID(0, "$NetBSD: key.c,v 1.74 2002/08/20 08:17:02 itojun Exp $");
#include "opt_inet.h" #include "opt_inet.h"
#include "opt_ipsec.h" #include "opt_ipsec.h"
@ -1722,8 +1722,7 @@ key_spddelete2(so, m, mhp)
if (mhp->ext[SADB_X_EXT_POLICY] == NULL || if (mhp->ext[SADB_X_EXT_POLICY] == NULL ||
mhp->extlen[SADB_X_EXT_POLICY] < sizeof(struct sadb_x_policy)) { mhp->extlen[SADB_X_EXT_POLICY] < sizeof(struct sadb_x_policy)) {
ipseclog((LOG_DEBUG, "key_spddelete2: invalid message is passed.\n")); ipseclog((LOG_DEBUG, "key_spddelete2: invalid message is passed.\n"));
key_senderror(so, m, EINVAL); return key_senderror(so, m, EINVAL);
return 0;
} }
id = ((struct sadb_x_policy *)mhp->ext[SADB_X_EXT_POLICY])->sadb_x_policy_id; id = ((struct sadb_x_policy *)mhp->ext[SADB_X_EXT_POLICY])->sadb_x_policy_id;
@ -1731,7 +1730,7 @@ key_spddelete2(so, m, mhp)
/* Is there SP in SPD ? */ /* Is there SP in SPD ? */
if ((sp = key_getspbyid(id)) == NULL) { if ((sp = key_getspbyid(id)) == NULL) {
ipseclog((LOG_DEBUG, "key_spddelete2: no SP found id:%u.\n", id)); ipseclog((LOG_DEBUG, "key_spddelete2: no SP found id:%u.\n", id));
key_senderror(so, m, EINVAL); return key_senderror(so, m, EINVAL);
} }
key_sp_dead(sp); key_sp_dead(sp);