From: Julia Lawall Date: Wed, 5 Aug 2009 12:34:55 +0000 (+0200) Subject: security/smack: Use AF_INET for sin_family field X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=da34d4248bd2013ee64ce51e63ec0ebd1f32b46c;p=openwrt%2Fstaging%2Fblogic.git security/smack: Use AF_INET for sin_family field Elsewhere the sin_family field holds a value with a name of the form AF_..., so it seems reasonable to do so here as well. Also the values of PF_INET and AF_INET are the same. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ struct sockaddr_in sip; @@ ( sip.sin_family == - PF_INET + AF_INET | sip.sin_family != - PF_INET + AF_INET | sip.sin_family = - PF_INET + AF_INET ) // Signed-off-by: Julia Lawall Acked-by: Casey Schaufler Signed-off-by: James Morris --- diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 1c9bdbcbe3d2..c243a2b25832 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -2464,7 +2464,7 @@ static int smack_socket_sendmsg(struct socket *sock, struct msghdr *msg, /* * Perfectly reasonable for this to be NULL */ - if (sip == NULL || sip->sin_family != PF_INET) + if (sip == NULL || sip->sin_family != AF_INET) return 0; return smack_netlabel_send(sock->sk, sip);