Subject: Re: [PATCH net-next v2] net: Initialize table in fib result

From: Sergey Senozhatsky <[email-masked]>
Date: Thu, 17 Sep 2015 09:00:52 +0900

On (09/16/15 10:16), David Ahern wrote:
[..]
> The root cause is use of res.table uninitialized.
> 
> Thanks to Nikolay for noticing the uninitialized use amongst the maze of
> gotos.
> 
> As Nikolay pointed out the second initialization is not required to fix
> the oops, but rather to fix a related problem where a valid lookup should
> be invalidated before creating the rth entry.
> 
> Fixes: b7503e0cdb5d ("net: Add FIB table id to rtable")
> Reported-by: Sergey Senozhatsky <[email-masked]>

works for me, thanks

Tested-by: Sergey Senozhatsky <[email-masked]>

	-ss

> Reported-by: Richard Alpe <[email-masked]>
> Reported-by: Fabio Estevam <[email-masked]>
> Tested-by: Fabio Estevam <[email-masked]>
> Signed-off-by: David Ahern <[email-masked]>
> ---
> v2:
> - clarification in the commit message regarding the second initialization
> 
>  net/ipv4/route.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index da427a4a33fe..80f7c5b7b832 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -1712,6 +1712,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
>  		goto martian_source;
>  
>  	res.fi = NULL;
> +	res.table = NULL;
>  	if (ipv4_is_lbcast(daddr) || (saddr == 0 && daddr == 0))
>  		goto brd_input;
>  
> @@ -1834,6 +1835,7 @@ out:	return err;
>  	RT_CACHE_STAT_INC(in_no_route);
>  	res.type = RTN_UNREACHABLE;
>  	res.fi = NULL;
> +	res.table = NULL;
>  	goto local_input;
>  
>  	/*
> -- 
> 2.3.2 (Apple Git-55)
>