Commit 9bb5fd2b authored by Paul Moore's avatar Paul Moore Committed by David S. Miller

NetLabel: use cipso_v4_doi_search() for local CIPSOv4 functions

The cipso_v4_doi_search() function behaves the same as cipso_v4_doi_getdef()
but is a local, static function so use it whenever possibile in the CIPSOv4
code base.
Signed-of-by: default avatarPaul Moore <paul.moore@hp.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent c6b1677a
...@@ -1135,7 +1135,7 @@ int cipso_v4_validate(unsigned char **option) ...@@ -1135,7 +1135,7 @@ int cipso_v4_validate(unsigned char **option)
} }
rcu_read_lock(); rcu_read_lock();
doi_def = cipso_v4_doi_getdef(ntohl(*((__be32 *)&opt[2]))); doi_def = cipso_v4_doi_search(ntohl(*((u32 *)&opt[2])));
if (doi_def == NULL) { if (doi_def == NULL) {
err_offset = 2; err_offset = 2;
goto validate_return_locked; goto validate_return_locked;
...@@ -1380,7 +1380,7 @@ int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr) ...@@ -1380,7 +1380,7 @@ int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr)
doi = ntohl(*(__be32 *)&cipso_ptr[2]); doi = ntohl(*(__be32 *)&cipso_ptr[2]);
rcu_read_lock(); rcu_read_lock();
doi_def = cipso_v4_doi_getdef(doi); doi_def = cipso_v4_doi_search(doi);
if (doi_def == NULL) { if (doi_def == NULL) {
rcu_read_unlock(); rcu_read_unlock();
return -ENOMSG; return -ENOMSG;
...@@ -1448,7 +1448,7 @@ int cipso_v4_skbuff_getattr(const struct sk_buff *skb, ...@@ -1448,7 +1448,7 @@ int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
doi = ntohl(*(__be32 *)&cipso_ptr[2]); doi = ntohl(*(__be32 *)&cipso_ptr[2]);
rcu_read_lock(); rcu_read_lock();
doi_def = cipso_v4_doi_getdef(doi); doi_def = cipso_v4_doi_search(doi);
if (doi_def == NULL) if (doi_def == NULL)
goto skbuff_getattr_return; goto skbuff_getattr_return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment