Message ID | 20200925124724.448531559@linuxfoundation.org |
---|---|
State | New |
Headers | show |
Series | None | expand |
Hi! > [ Upstream commit 2fbc6e89b2f1403189e624cabaf73e189c5e50c6 ] > > Kfir reported that pmtu exceptions are not created properly for > deployments where multipath routes use the same device. This is mismerged (in a way that does not affect functionality): > @@ -779,6 +779,8 @@ static void __ip_do_redirect(struct rtab > if (fib_lookup(net, fl4, &res, 0) == 0) { > struct fib_nh *nh = &FIB_RES_NH(res); > > + fib_select_path(net, &res, fl4, skb); > + nh = &FIB_RES_NH(res); > update_or_create_fnhe(nh, fl4->daddr, new_gw, > 0, false, nh is assigned value that is never used. Mainline patch removes the assignment (but variable has different type). 4.19 should delete the assignment, too. Best regards, Pavel Signed-off-by: Pavel Machek (CIP) <pavel@denx.de> diff --git a/net/ipv4/route.c b/net/ipv4/route.c index f60e28418ece..84de87b7eedc 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -777,7 +777,7 @@ static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb, struct flow neigh_event_send(n, NULL); } else { if (fib_lookup(net, fl4, &res, 0) == 0) { - struct fib_nh *nh = &FIB_RES_NH(res); + struct fib_nh *nh; fib_select_path(net, &res, fl4, skb); nh = &FIB_RES_NH(res);
On Fri, Sep 25, 2020 at 06:51:34PM +0200, Pavel Machek wrote: > Hi! > > > [ Upstream commit 2fbc6e89b2f1403189e624cabaf73e189c5e50c6 ] > > > > Kfir reported that pmtu exceptions are not created properly for > > deployments where multipath routes use the same device. > > This is mismerged (in a way that does not affect functionality): > > > > @@ -779,6 +779,8 @@ static void __ip_do_redirect(struct rtab > > if (fib_lookup(net, fl4, &res, 0) == 0) { > > struct fib_nh *nh = &FIB_RES_NH(res); > > > > + fib_select_path(net, &res, fl4, skb); > > + nh = &FIB_RES_NH(res); > > update_or_create_fnhe(nh, fl4->daddr, new_gw, > > 0, false, > > nh is assigned value that is never used. Mainline patch removes the > assignment (but variable has different type). > > 4.19 should delete the assignment, too. Ah, good catch, I'll merge this in, thanks. greg k-h
On Sat 2020-09-26 17:46:35, Greg Kroah-Hartman wrote: > On Fri, Sep 25, 2020 at 06:51:34PM +0200, Pavel Machek wrote: > > Hi! > > > > > [ Upstream commit 2fbc6e89b2f1403189e624cabaf73e189c5e50c6 ] > > > > > > Kfir reported that pmtu exceptions are not created properly for > > > deployments where multipath routes use the same device. > > > > This is mismerged (in a way that does not affect functionality): > > > > > > > @@ -779,6 +779,8 @@ static void __ip_do_redirect(struct rtab > > > if (fib_lookup(net, fl4, &res, 0) == 0) { > > > struct fib_nh *nh = &FIB_RES_NH(res); > > > > > > + fib_select_path(net, &res, fl4, skb); > > > + nh = &FIB_RES_NH(res); > > > update_or_create_fnhe(nh, fl4->daddr, new_gw, > > > 0, false, > > > > nh is assigned value that is never used. Mainline patch removes the > > assignment (but variable has different type). > > > > 4.19 should delete the assignment, too. > > Ah, good catch, I'll merge this in, thanks. Thank you! Pavel -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
--- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -779,6 +779,8 @@ static void __ip_do_redirect(struct rtab if (fib_lookup(net, fl4, &res, 0) == 0) { struct fib_nh *nh = &FIB_RES_NH(res); + fib_select_path(net, &res, fl4, skb); + nh = &FIB_RES_NH(res); update_or_create_fnhe(nh, fl4->daddr, new_gw, 0, false, jiffies + ip_rt_gc_timeout); @@ -1004,6 +1006,7 @@ out: kfree_skb(skb); static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu) { struct dst_entry *dst = &rt->dst; + struct net *net = dev_net(dst->dev); u32 old_mtu = ipv4_mtu(dst); struct fib_result res; bool lock = false; @@ -1024,9 +1027,11 @@ static void __ip_rt_update_pmtu(struct r return; rcu_read_lock(); - if (fib_lookup(dev_net(dst->dev), fl4, &res, 0) == 0) { - struct fib_nh *nh = &FIB_RES_NH(res); + if (fib_lookup(net, fl4, &res, 0) == 0) { + struct fib_nh *nh; + fib_select_path(net, &res, fl4, NULL); + nh = &FIB_RES_NH(res); update_or_create_fnhe(nh, fl4->daddr, 0, mtu, lock, jiffies + ip_rt_mtu_expires); } @@ -2536,8 +2541,6 @@ struct rtable *ip_route_output_key_hash_ fib_select_path(net, res, fl4, skb); dev_out = FIB_RES_DEV(*res); - fl4->flowi4_oif = dev_out->ifindex; - make_route: rth = __mkroute_output(res, fl4, orig_oif, dev_out, flags);