Linux Security Modules development
 help / color / mirror / Atom feed
* [PATCH next] security: smack: fix sap undeclared error in smack_socket_sendmsg
@ 2019-05-09 12:46 Kefeng Wang
  2019-05-09 15:29 ` Casey Schaufler
  0 siblings, 1 reply; 3+ messages in thread
From: Kefeng Wang @ 2019-05-09 12:46 UTC (permalink / raw)
  To: Tetsuo Handa, Casey Schaufler, linux-security-module; +Cc: Kefeng Wang

If CONFIG_IPV6 is disabled, there is build error, fix it.

security/smack/smack_lsm.c: In function ‘smack_socket_sendmsg’:
security/smack/smack_lsm.c:3698:7: error: ‘sap’ undeclared (first use in this function)
     sap->sin6_family != AF_INET6)

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 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 b5b333d72637..ff5b7dc6816f 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -3693,6 +3693,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)
@@ -3707,6 +3708,7 @@ static int smack_socket_sendmsg(struct socket *sock, struct msghdr *msg,
 		rc = smk_ipv6_port_check(sock->sk, sap, SMK_SENDING);
 #endif
 		break;
+#endif
 	}
 	return rc;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-10  1:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-09 12:46 [PATCH next] security: smack: fix sap undeclared error in smack_socket_sendmsg Kefeng Wang
2019-05-09 15:29 ` Casey Schaufler
2019-05-10  1:01   ` Kefeng Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox