ipsec: prohibit unknown directions in key_havesp
Eliminates a branch checking for its validity. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D36485
This commit is contained in:
parent
1ffc369aa3
commit
86104d3ebb
@ -806,8 +806,9 @@ int
|
|||||||
key_havesp(u_int dir)
|
key_havesp(u_int dir)
|
||||||
{
|
{
|
||||||
|
|
||||||
return (dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND ?
|
IPSEC_ASSERT(dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND,
|
||||||
TAILQ_FIRST(&V_sptree[dir]) != NULL : 1);
|
("invalid direction %u", dir));
|
||||||
|
return (TAILQ_FIRST(&V_sptree[dir]) != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* %%% IPsec policy management */
|
/* %%% IPsec policy management */
|
||||||
|
Loading…
Reference in New Issue
Block a user