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:
+3
-2
@@ -806,8 +806,9 @@ int
|
||||
key_havesp(u_int dir)
|
||||
{
|
||||
|
||||
return (dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND ?
|
||||
TAILQ_FIRST(&V_sptree[dir]) != NULL : 1);
|
||||
IPSEC_ASSERT(dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND,
|
||||
("invalid direction %u", dir));
|
||||
return (TAILQ_FIRST(&V_sptree[dir]) != NULL);
|
||||
}
|
||||
|
||||
/* %%% IPsec policy management */
|
||||
|
||||
Reference in New Issue
Block a user