All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SELinux: remove unused and shadowed addrlen variable
@ 2008-06-11 16:00 James Morris
  2008-06-11 16:06 ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: James Morris @ 2008-06-11 16:00 UTC (permalink / raw)
  To: selinux; +Cc: Stephen Smalley, Eric Paris

Please review.

----
Remove unused and shadowed addrlen variable.  Picked up by sparse.

Signed-off-by: James Morris <jmorris@namei.org>
---
 security/selinux/hooks.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index f530008..6e8d0e9 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3669,7 +3669,7 @@ static int selinux_socket_bind(struct socket *sock, struct sockaddr *address, in
 		struct sockaddr_in6 *addr6 = NULL;
 		unsigned short snum;
 		struct sock *sk = sock->sk;
-		u32 sid, node_perm, addrlen;
+		u32 sid, node_perm;
 
 		tsec = current->security;
 		isec = SOCK_INODE(sock)->i_security;
@@ -3677,12 +3677,10 @@ static int selinux_socket_bind(struct socket *sock, struct sockaddr *address, in
 		if (family == PF_INET) {
 			addr4 = (struct sockaddr_in *)address;
 			snum = ntohs(addr4->sin_port);
-			addrlen = sizeof(addr4->sin_addr.s_addr);
 			addrp = (char *)&addr4->sin_addr.s_addr;
 		} else {
 			addr6 = (struct sockaddr_in6 *)address;
 			snum = ntohs(addr6->sin6_port);
-			addrlen = sizeof(addr6->sin6_addr.s6_addr);
 			addrp = (char *)&addr6->sin6_addr.s6_addr;
 		}
 
-- 
1.5.5.1


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

* Re: [PATCH] SELinux: remove unused and shadowed addrlen variable
  2008-06-11 16:00 [PATCH] SELinux: remove unused and shadowed addrlen variable James Morris
@ 2008-06-11 16:06 ` Stephen Smalley
  2008-06-11 19:03   ` Paul Moore
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Smalley @ 2008-06-11 16:06 UTC (permalink / raw)
  To: James Morris; +Cc: selinux, Eric Paris


On Thu, 2008-06-12 at 02:00 +1000, James Morris wrote:
> Please review.
> 
> ----
> Remove unused and shadowed addrlen variable.  Picked up by sparse.
> 
> Signed-off-by: James Morris <jmorris@namei.org>

It was used previously but obsoleted by the netnode cache interface.

Acked-by:  Stephen Smalley <sds@tycho.nsa.gov>

> ---
>  security/selinux/hooks.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index f530008..6e8d0e9 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -3669,7 +3669,7 @@ static int selinux_socket_bind(struct socket *sock, struct sockaddr *address, in
>  		struct sockaddr_in6 *addr6 = NULL;
>  		unsigned short snum;
>  		struct sock *sk = sock->sk;
> -		u32 sid, node_perm, addrlen;
> +		u32 sid, node_perm;
>  
>  		tsec = current->security;
>  		isec = SOCK_INODE(sock)->i_security;
> @@ -3677,12 +3677,10 @@ static int selinux_socket_bind(struct socket *sock, struct sockaddr *address, in
>  		if (family == PF_INET) {
>  			addr4 = (struct sockaddr_in *)address;
>  			snum = ntohs(addr4->sin_port);
> -			addrlen = sizeof(addr4->sin_addr.s_addr);
>  			addrp = (char *)&addr4->sin_addr.s_addr;
>  		} else {
>  			addr6 = (struct sockaddr_in6 *)address;
>  			snum = ntohs(addr6->sin6_port);
> -			addrlen = sizeof(addr6->sin6_addr.s6_addr);
>  			addrp = (char *)&addr6->sin6_addr.s6_addr;
>  		}
>  
-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

* Re: [PATCH] SELinux: remove unused and shadowed addrlen variable
  2008-06-11 16:06 ` Stephen Smalley
@ 2008-06-11 19:03   ` Paul Moore
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Moore @ 2008-06-11 19:03 UTC (permalink / raw)
  To: Stephen Smalley; +Cc: James Morris, selinux, Eric Paris

On Wednesday 11 June 2008 12:06:45 pm Stephen Smalley wrote:
> On Thu, 2008-06-12 at 02:00 +1000, James Morris wrote:
> > Please review.
> >
> > ----
> > Remove unused and shadowed addrlen variable.  Picked up by sparse.
> >
> > Signed-off-by: James Morris <jmorris@namei.org>
>
> It was used previously but obsoleted by the netnode cache interface.
>
> Acked-by:  Stephen Smalley <sds@tycho.nsa.gov>

Yes, I removed a bunch of similar address length variables but it looks 
like I missed one - sorry about that.

Acked-by: Paul Moore <paul.moore@hp.com>

> > ---
> >  security/selinux/hooks.c |    4 +---
> >  1 files changed, 1 insertions(+), 3 deletions(-)
> >
> > diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> > index f530008..6e8d0e9 100644
> > --- a/security/selinux/hooks.c
> > +++ b/security/selinux/hooks.c
> > @@ -3669,7 +3669,7 @@ static int selinux_socket_bind(struct socket
> > *sock, struct sockaddr *address, in struct sockaddr_in6 *addr6 =
> > NULL;
> >  		unsigned short snum;
> >  		struct sock *sk = sock->sk;
> > -		u32 sid, node_perm, addrlen;
> > +		u32 sid, node_perm;
> >
> >  		tsec = current->security;
> >  		isec = SOCK_INODE(sock)->i_security;
> > @@ -3677,12 +3677,10 @@ static int selinux_socket_bind(struct
> > socket *sock, struct sockaddr *address, in if (family == PF_INET) {
> >  			addr4 = (struct sockaddr_in *)address;
> >  			snum = ntohs(addr4->sin_port);
> > -			addrlen = sizeof(addr4->sin_addr.s_addr);
> >  			addrp = (char *)&addr4->sin_addr.s_addr;
> >  		} else {
> >  			addr6 = (struct sockaddr_in6 *)address;
> >  			snum = ntohs(addr6->sin6_port);
> > -			addrlen = sizeof(addr6->sin6_addr.s6_addr);
> >  			addrp = (char *)&addr6->sin6_addr.s6_addr;
> >  		}



-- 
paul moore
linux @ hp

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

end of thread, other threads:[~2008-06-11 19:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-11 16:00 [PATCH] SELinux: remove unused and shadowed addrlen variable James Morris
2008-06-11 16:06 ` Stephen Smalley
2008-06-11 19:03   ` Paul Moore

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.