]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.20.16/apparmor-fix-warning-about-unused-function-apparmor_.patch
Linux 4.20.16
[thirdparty/kernel/stable-queue.git] / releases / 4.20.16 / apparmor-fix-warning-about-unused-function-apparmor_.patch
1 From f43f22d16d2749f556fcd4efeb90347bf6e9afec Mon Sep 17 00:00:00 2001
2 From: Petr Vorel <pvorel@suse.cz>
3 Date: Mon, 12 Nov 2018 11:59:12 +0100
4 Subject: apparmor: Fix warning about unused function apparmor_ipv6_postroute
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 [ Upstream commit a1a02062ad466052a34a8c4323143ccf9726eb52 ]
10
11 when compiled without CONFIG_IPV6:
12 security/apparmor/lsm.c:1601:21: warning: ‘apparmor_ipv6_postroute’ defined but not used [-Wunused-function]
13 static unsigned int apparmor_ipv6_postroute(void *priv,
14 ^~~~~~~~~~~~~~~~~~~~~~~
15
16 Reported-by: Jordan Glover <Golden_Miller83@protonmail.ch>
17 Tested-by: Jordan Glover <Golden_Miller83@protonmail.ch>
18 Signed-off-by: Petr Vorel <pvorel@suse.cz>
19 Signed-off-by: John Johansen <john.johansen@canonical.com>
20 Signed-off-by: Sasha Levin <sashal@kernel.org>
21 ---
22 security/apparmor/lsm.c | 2 ++
23 1 file changed, 2 insertions(+)
24
25 diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
26 index 42446a216f3b..7d1eeb084968 100644
27 --- a/security/apparmor/lsm.c
28 +++ b/security/apparmor/lsm.c
29 @@ -1598,12 +1598,14 @@ static unsigned int apparmor_ipv4_postroute(void *priv,
30 return apparmor_ip_postroute(priv, skb, state);
31 }
32
33 +#if IS_ENABLED(CONFIG_IPV6)
34 static unsigned int apparmor_ipv6_postroute(void *priv,
35 struct sk_buff *skb,
36 const struct nf_hook_state *state)
37 {
38 return apparmor_ip_postroute(priv, skb, state);
39 }
40 +#endif
41
42 static const struct nf_hook_ops apparmor_nf_ops[] = {
43 {
44 --
45 2.19.1
46