]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smack: dont compile ipv6 code unless ipv6 is configured
authorKonstantin Andreev <andreev@swemel.ru>
Fri, 17 Jan 2025 16:36:42 +0000 (19:36 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:33:30 +0000 (14:33 +0200)
commitd6937b1b4a23632ee316905348aa16ac259474d1
tree45dc00a9451823a3a873837c27b609c6f3c98be5
parentc678f0831b1e09ccc09f5cc0d9e703d97f002226
smack: dont compile ipv6 code unless ipv6 is configured

[ Upstream commit bfcf4004bcbce2cb674b4e8dbd31ce0891766bac ]

I want to be sure that ipv6-specific code
is not compiled in kernel binaries
if ipv6 is not configured.

[1] was getting rid of "unused variable" warning, but,
with that, it also mandated compilation of a handful ipv6-
specific functions in ipv4-only kernel configurations:

smk_ipv6_localhost, smack_ipv6host_label, smk_ipv6_check.

Their compiled bodies are likely to be removed by compiler
from the resulting binary, but, to be on the safe side,
I remove them from the compiler view.

[1]
Fixes: 00720f0e7f28 ("smack: avoid unused 'sip' variable warning")
Signed-off-by: Konstantin Andreev <andreev@swemel.ru>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/smack/smack.h
security/smack/smack_lsm.c