diff mbox series

[apparmor] apparmor: remove unneeded one-line hook wrappers

Message ID 20211011143854.17917-1-fw@strlen.de (mailing list archive)
State New, archived
Headers show
Series [apparmor] apparmor: remove unneeded one-line hook wrappers | expand

Commit Message

Florian Westphal Oct. 11, 2021, 2:38 p.m. UTC
Use the common function directly.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 security/apparmor/lsm.c | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

Comments

John Johansen Nov. 12, 2021, 1:26 a.m. UTC | #1
On 10/11/21 7:38 AM, Florian Westphal wrote:
> Use the common function directly.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>

sorry, it looks like I forgot to reply to this. I pulled this into the
apparmor tree and it has been merged for 5.16

> ---
>  security/apparmor/lsm.c | 20 ++------------------
>  1 file changed, 2 insertions(+), 18 deletions(-)
> 
> diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
> index f72406fe1bf2..eafb44aa553a 100644
> --- a/security/apparmor/lsm.c
> +++ b/security/apparmor/lsm.c
> @@ -1773,32 +1773,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,
>
diff mbox series

Patch

diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index f72406fe1bf2..eafb44aa553a 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -1773,32 +1773,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,