public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] security/smack: Use AF_INET for sin_family field
@ 2009-08-05 12:34 Julia Lawall
  2009-08-05 19:38 ` Casey Schaufler
  2009-08-05 22:47 ` James Morris
  0 siblings, 2 replies; 3+ messages in thread
From: Julia Lawall @ 2009-08-05 12:34 UTC (permalink / raw)
  To: James Morris, linux-security-module, linux-kernel,
	kernel-janitors

From: Julia Lawall <julia@diku.dk>

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/)

// <smpl>
@@
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
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 security/smack/smack_lsm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -2464,7 +2464,7 @@ static int smack_socket_sendmsg(struct s
 	/*
 	 * 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);

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

end of thread, other threads:[~2009-08-05 22:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-05 12:34 [PATCH 2/2] security/smack: Use AF_INET for sin_family field Julia Lawall
2009-08-05 19:38 ` Casey Schaufler
2009-08-05 22:47 ` James Morris

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