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] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.11.1409292224230.2304@ja.home.ssi.bg>
Date:	Mon, 29 Sep 2014 22:30:03 +0300 (EEST)
From:	Julian Anastasov <ja@....bg>
To:	roy.qing.li@...il.com
cc:	netdev@...r.kernel.org
Subject: Re: [PATCH][net-next] ipv4: unnecessary to set err on no_route
 path


	Hello,

On Mon, 29 Sep 2014, roy.qing.li@...il.com wrote:

> From: Li RongQing <roy.qing.li@...il.com>
> 
> When the code skips to no_route label, it will skip to local_input at last,
> then err will be reset on the local_input path before exit function.

	But local_input saves -err into rth->dst.error,
the places you change provided more-specific error code.

> Signed-off-by: Li RongQing <roy.qing.li@...il.com>
> ---
>  net/ipv4/route.c |   11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index d4bd68d..403914b 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -1704,11 +1704,9 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
>  	fl4.daddr = daddr;
>  	fl4.saddr = saddr;
>  	err = fib_lookup(net, &fl4, &res);
> -	if (err != 0) {
> -		if (!IN_DEV_FORWARD(in_dev))
> -			err = -EHOSTUNREACH;
> +	if (err != 0)
>  		goto no_route;
> -	}
> +
>  
>  	if (res.type == RTN_BROADCAST)
>  		goto brd_input;
> @@ -1721,10 +1719,9 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
>  		goto local_input;
>  	}
>  
> -	if (!IN_DEV_FORWARD(in_dev)) {
> -		err = -EHOSTUNREACH;
> +	if (!IN_DEV_FORWARD(in_dev))
>  		goto no_route;
> -	}
> +
>  	if (res.type != RTN_UNICAST)
>  		goto martian_destination;
>  
> -- 
> 1.7.10.4

Regards

--
Julian Anastasov <ja@....bg>
--
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