From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] route: check sysctl_fib_multipath_use_neigh earlier than hash Date: Sun, 01 Apr 2018 20:58:05 -0400 (EDT) Message-ID: <20180401.205805.1233503591936620975.davem@davemloft.net> References: <6265ae9495a93efac372d41001c5ebccbb916df7.1522593635.git.lucien.xin@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, ja@ssi.bg, dsa@cumulusnetworks.com To: lucien.xin@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:59616 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753992AbeDBA6H (ORCPT ); Sun, 1 Apr 2018 20:58:07 -0400 In-Reply-To: <6265ae9495a93efac372d41001c5ebccbb916df7.1522593635.git.lucien.xin@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Xin Long Date: Sun, 1 Apr 2018 22:40:35 +0800 > Prior to this patch, when one packet is hashed into path [1] > (hash <= nh_upper_bound) and it's neigh is dead, it will try > path [2]. However, if path [2]'s neigh is alive but it's > hash > nh_upper_bound, it will not return this alive path. > This packet will never be sent even if path [2] is alive. > > 3.3.3.1/24: > nexthop via 1.1.1.254 dev eth1 weight 1 <--[1] (dead neigh) > nexthop via 2.2.2.254 dev eth2 weight 1 <--[2] > > With sysctl_fib_multipath_use_neigh set is supposed to find an > available path respecting to the l3/l4 hash. But if there is > no available route with this hash, it should at least return > an alive route even with other hash. > > This patch is to fix it by processing fib_multipath_use_neigh > earlier than the hash check, so that it will at least return > an alive route if there is when fib_multipath_use_neigh is > enabled. It's also compatible with before when there are alive > routes with the l3/l4 hash. > > Fixes: a6db4494d218 ("net: ipv4: Consider failed nexthops in multipath routes") > Reported-by: Jianlin Shi > Signed-off-by: Xin Long Applied and queued up for -stable, thanks.