]> 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:39:10 +0000 (14:39 +0200)
commit9d93922280f90f3ce5d7e041e4d6d5d8c54d433c
treefb8ac13469873c4691541a04d477130c99f53749
parent40426fc0970e24b3f681b0d3bf040ab454d7e280
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