Re: [PATCH net-next 1/8] net: ipv4: refactor __ip_route_output_key_hash
From: Roopa Prabhu <hidden>
Date: 2017-05-25 03:05:10
On Wed, May 24, 2017 at 6:10 PM, David Ahern [off-list ref] wrote:
On 5/24/17 1:33 PM, Rosen, Rami wrote:quoted
Hi, Rupa /David Ahern, First, thanks for this patch set! Second, it seems to me that something might be incorrect here. You have these additions in this patch (1/8): ... +struct rtable *ip_route_output_key_hash_rcu(struct net *net, struct flowi4 *flp, + const struct sk_buff *skb, + struct fib_result *res); ... +struct rtable *ip_route_output_key_hash(struct net *net, struct flowi4 *fl4, + const struct sk_buff *skb) +{ + struct fib_result res; + struct rtable *rth; + + res.tclassid = 0; + res.fi = NULL; + res.table = NULL; + + rcu_read_lock(); + rth = ip_route_output_key_hash_rcu(net, fl4, &res, mp_hash); rcu_read_unlock(); + return rth; } -EXPORT_SYMBOL_GPL(__ip_route_output_key_hash); +EXPORT_SYMBOL_GPL(ip_route_output_key_hash); So the third parameter to ip_route_output_key_hash_rcu() should be skb*, and the fourth parameter should be fib_result *. However, you do not pass the skb parameter when calling ip_route_output_key_hash_rcu() in ip_route_output_key_hash() (in fact you don't use it at all), and you pass mp_hash as the fourth parameter.Yep, it's a problem with the forward port of the first round of patches.
yep,
Roopa: in include/net/route.h, __ip_route_output_key_hash should be removed as well.
ack, thanks Rami and david. will fix it in v2.