mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
NetLabel: check for a CIPSOv4 option before we do call into the CIPSOv4 layer
Right now the NetLabel code always jumps into the CIPSOv4 layer to determine if a CIPSO IP option is present. However, we can do this check directly in the NetLabel code by making use of the CIPSO_V4_OPTEXIST() macro which should save us a function call in the common case of not having a CIPSOv4 option present. Signed-off-by: Paul Moore <[email protected]> Signed-off-by: James Morris <[email protected]>
This commit is contained in:
parent
701a90bad9
commit
05e00cbf50
2 changed files with 2 additions and 6 deletions
|
|
@ -149,10 +149,8 @@ int netlbl_socket_getattr(const struct socket *sock,
|
|||
int netlbl_skbuff_getattr(const struct sk_buff *skb,
|
||||
struct netlbl_lsm_secattr *secattr)
|
||||
{
|
||||
int ret_val;
|
||||
|
||||
ret_val = cipso_v4_skbuff_getattr(skb, secattr);
|
||||
if (ret_val == 0)
|
||||
if (CIPSO_V4_OPTEXIST(skb) &&
|
||||
cipso_v4_skbuff_getattr(skb, secattr) == 0)
|
||||
return 0;
|
||||
|
||||
return netlbl_unlabel_getattr(secattr);
|
||||
|
|
|
|||
Loading…
Reference in a new issue