From 6ac8662b1b4f98c04e21596a3d8e1f74bc19e092 Mon Sep 17 00:00:00 2001 From: Casey Schaufler Date: Tue, 30 Apr 2019 14:13:32 -0700 Subject: [PATCH] Smack: Fix kbuild reported build error The variable sap is defined under ifdef, but a recently added use of the variable was not. Put that use under ifdef as well. Reported-by: kbuild test robot Signed-off-by: Casey Schaufler --- security/smack/smack_lsm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 4b59e4519e0c1..ba300b540a09c 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -3692,6 +3692,7 @@ static int smack_socket_sendmsg(struct socket *sock, struct msghdr *msg, return -EINVAL; rc = smack_netlabel_send(sock->sk, sip); break; +#if IS_ENABLED(CONFIG_IPV6) case AF_INET6: if (msg->msg_namelen < SIN6_LEN_RFC2133 || sap->sin6_family != AF_INET6) @@ -3705,6 +3706,7 @@ static int smack_socket_sendmsg(struct socket *sock, struct msghdr *msg, #ifdef SMACK_IPV6_PORT_LABELING rc = smk_ipv6_port_check(sock->sk, sap, SMK_SENDING); #endif +#endif /* IS_ENABLED(CONFIG_IPV6) */ break; } return rc;