Return early, reduce identation (NFCI)
This commit is contained in:
parent
a423f64965
commit
da67e76875
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: key.c,v 1.112 2017/04/19 07:19:46 ozaki-r Exp $ */
|
||||
/* $NetBSD: key.c,v 1.113 2017/04/19 09:22:17 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.112 2017/04/19 07:19:46 ozaki-r Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.113 2017/04/19 09:22:17 ozaki-r Exp $");
|
||||
|
||||
/*
|
||||
* This code is referd to RFC 2367
|
||||
|
@ -1465,9 +1465,20 @@ key_msg2sp(const struct sadb_x_policy *xpl0, size_t len, int *error)
|
|||
case IPSEC_POLICY_ENTRUST:
|
||||
case IPSEC_POLICY_BYPASS:
|
||||
newsp->req = NULL;
|
||||
break;
|
||||
*error = 0;
|
||||
return newsp;
|
||||
|
||||
case IPSEC_POLICY_IPSEC:
|
||||
/* Continued */
|
||||
break;
|
||||
default:
|
||||
ipseclog((LOG_DEBUG, "key_msg2sp: invalid policy type.\n"));
|
||||
KEY_FREESP(&newsp);
|
||||
*error = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* IPSEC_POLICY_IPSEC */
|
||||
{
|
||||
int tlen;
|
||||
const struct sadb_x_ipsecrequest *xisr;
|
||||
|
@ -1635,13 +1646,6 @@ key_msg2sp(const struct sadb_x_policy *xpl0, size_t len, int *error)
|
|||
+ xisr->sadb_x_ipsecrequest_len);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ipseclog((LOG_DEBUG, "key_msg2sp: invalid policy type.\n"));
|
||||
KEY_FREESP(&newsp);
|
||||
*error = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*error = 0;
|
||||
return newsp;
|
||||
|
|
Loading…
Reference in New Issue