Skip to content
Snippets Groups Projects
Commit f8de49ef authored by Florian Westphal's avatar Florian Westphal Committed by Casey Schaufler
Browse files

smack: remove duplicated hook function


ipv4 and ipv6 hook functions are identical, remove one.

Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
parent 387ef964
No related branches found
No related tags found
No related merge requests found
...@@ -18,27 +18,7 @@ ...@@ -18,27 +18,7 @@
#include <net/net_namespace.h> #include <net/net_namespace.h>
#include "smack.h" #include "smack.h"
#if IS_ENABLED(CONFIG_IPV6) static unsigned int smack_ip_output(void *priv,
static unsigned int smack_ipv6_output(void *priv,
struct sk_buff *skb,
const struct nf_hook_state *state)
{
struct sock *sk = skb_to_full_sk(skb);
struct socket_smack *ssp;
struct smack_known *skp;
if (sk && sk->sk_security) {
ssp = sk->sk_security;
skp = ssp->smk_out;
skb->secmark = skp->smk_secid;
}
return NF_ACCEPT;
}
#endif /* IPV6 */
static unsigned int smack_ipv4_output(void *priv,
struct sk_buff *skb, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
...@@ -57,14 +37,14 @@ static unsigned int smack_ipv4_output(void *priv, ...@@ -57,14 +37,14 @@ static unsigned int smack_ipv4_output(void *priv,
static const struct nf_hook_ops smack_nf_ops[] = { static const struct nf_hook_ops smack_nf_ops[] = {
{ {
.hook = smack_ipv4_output, .hook = smack_ip_output,
.pf = NFPROTO_IPV4, .pf = NFPROTO_IPV4,
.hooknum = NF_INET_LOCAL_OUT, .hooknum = NF_INET_LOCAL_OUT,
.priority = NF_IP_PRI_SELINUX_FIRST, .priority = NF_IP_PRI_SELINUX_FIRST,
}, },
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
{ {
.hook = smack_ipv6_output, .hook = smack_ip_output,
.pf = NFPROTO_IPV6, .pf = NFPROTO_IPV6,
.hooknum = NF_INET_LOCAL_OUT, .hooknum = NF_INET_LOCAL_OUT,
.priority = NF_IP6_PRI_SELINUX_FIRST, .priority = NF_IP6_PRI_SELINUX_FIRST,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment