lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49E4039C.5080908@cn.fujitsu.com>
Date:	Tue, 14 Apr 2009 11:31:40 +0800
From:	Shan Wei <shanwei@...fujitsu.com>
To:	Yang Hongyang <yanghy@...fujitsu.com>
CC:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	David Miller <davem@...emloft.net>, brian.haley@...com
Subject: Re: [PATCH]ipv6:remove useless check

Yang Hongyang said:
> After switch (rthdr->type) {...},the check below is completely useless.Because:
> if the type is 2,then hdrlen must be 2 and segments_left must be 1,clearly the
> check is redundant;if the type is not 2,then goto sticky_done,the check is useless
> too.
> 

Add CC  Brian Haley.

The check is defined only for Type 0 Routing header in section 4.4 of RFC2460: 

   Hdr Ext Len          8-bit unsigned integer.  Length of the Routing
                        header in 8-octet units, not including the first
                        8 octets.  For the Type 0 Routing header, Hdr
                        Ext Len is equal to two times the number of
                        addresses in the header.

Now, Type 0 Routing header has been removed, the check is redundant.

Reviewed-by: Shan Wei <shanwei@...fujitsu.com>

> Signed-off-by: Yang Hongyang <yanghy@...fujitsu.com>
> 
> ---
>  net/ipv6/ipv6_sockglue.c |    4 ----
>  1 files changed, 0 insertions(+), 4 deletions(-)
> 
> diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
> index d31df0f..a7fdf9a 100644
> --- a/net/ipv6/ipv6_sockglue.c
> +++ b/net/ipv6/ipv6_sockglue.c
> @@ -380,10 +380,6 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
>  			default:
>  				goto sticky_done;
>  			}
> -
> -			if ((rthdr->hdrlen & 1) ||
> -			    (rthdr->hdrlen >> 1) != rthdr->segments_left)
> -				goto sticky_done;
>  		}
>  
>  		retv = 0;

-- 
Best Regards
Shan Wei
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ