Skip to content

Commit

Permalink
apparmor: remove unneeded one-line hook wrappers
Browse files Browse the repository at this point in the history
Use the common function directly.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: John Johansen <john.johansen@canonical.com>
  • Loading branch information
Florian Westphal authored and John Johansen committed Nov 3, 2021
1 parent f4a2d28 commit 7b72112
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions security/apparmor/lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1763,32 +1763,16 @@ static unsigned int apparmor_ip_postroute(void *priv,

}

static unsigned int apparmor_ipv4_postroute(void *priv,
struct sk_buff *skb,
const struct nf_hook_state *state)
{
return apparmor_ip_postroute(priv, skb, state);
}

#if IS_ENABLED(CONFIG_IPV6)
static unsigned int apparmor_ipv6_postroute(void *priv,
struct sk_buff *skb,
const struct nf_hook_state *state)
{
return apparmor_ip_postroute(priv, skb, state);
}
#endif

static const struct nf_hook_ops apparmor_nf_ops[] = {
{
.hook = apparmor_ipv4_postroute,
.hook = apparmor_ip_postroute,
.pf = NFPROTO_IPV4,
.hooknum = NF_INET_POST_ROUTING,
.priority = NF_IP_PRI_SELINUX_FIRST,
},
#if IS_ENABLED(CONFIG_IPV6)
{
.hook = apparmor_ipv6_postroute,
.hook = apparmor_ip_postroute,
.pf = NFPROTO_IPV6,
.hooknum = NF_INET_POST_ROUTING,
.priority = NF_IP6_PRI_SELINUX_FIRST,
Expand Down

0 comments on commit 7b72112

Please sign in to comment.