From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796431049; b=3TRsn5GsQ/GTvFoILC2OGg4om7/ZionUl5oed1t/o70n7H/gqP1jX6QIYS5lYJM2aTEa zPw22UTtgfkyiwx+YbryBfrVrhD3C6f8GmHaDPcMtuaXMOWv6pm1u1JxAN2he9IgFbilj rOZZXEnS+z7EL7ZaVz6eaG0M1gJRb8Md+ffTLMRVup8QZnkqQLGW/wxTzHgj3sWE5Rner 6fd87TgF2c6xVCa4gJqOzX70kieeC1bC+1IDWRjOITIpqwyFc5KcdN0RrF7JcmDfFF4pQ yhrEDVqC6oje/e/+TsO5OEyX9IbQwJ+LjptyKqyYsLINOOmnUq3Zuh6sn19p8fv6qsQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796431049; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=+xwjewBGbK1dCS/cp2Ssupilg3o4AHRGn51mIXv06zo=; b=IadtmMnuhAOhLCHLRvM4N4dHzQdjOvKP+UTzkrySRxUgtGyBz+5GVTpTy8ST0DKbfhF+ tz9k0G/z8ygC2nc5mr3VjqizQxwFyqxsjNFP7OGioDO0h5M5R/q2A/vJyqf4qS9tgCBnE aeJI1ZM5d+bNCZzluFtgjdlAGrhF0tPbN2thuNHL5TlFYdjQ4qSoN+pvvkeikXr02Dm0c a+1BwG+Bg8EDGEBX55Loa+GrofTfkJ33s0Eb/bCEzCfukqzkeXSlP/4EpBLxolhngpsgR SytFWbFAbXixr+86Lh8fNmldfl3R0zP95s8sNaJ1lJ1wmoBVmlKxss4gb6uFnWnJ2mw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UI0w9yZ+; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6CC8606A322; Sat, 5 Dec 2026 00:37:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UI0w9yZ+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 703821F0092B; Sat, 5 Dec 2026 00:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796431049; bh=+xwjewBGbK1dCS/cp2Ssupilg3o4AHRGn51mIXv06zo=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=UI0w9yZ+8BP3SkLnGF6YXRKBh/DCr+cmoi0jo+FfB3XzgNlI1sOGtkwHSBeNLgY5f tYKncIgEoYG88oOXYglahiVi1ShGCtawPv2ikeXgyG4f6lX9TrhuKPVg1Kv/4ZSQxv fl7J6HHYetTbvaS26lzEx90BD7VmxJnH0OY/d/PW2RfmVgWQZIZW02syCGsU+zO8Yp pvnmXMQH4LVCDHfL9fIbcUJ8J9GA/3BbTRoY8naaVKhl31VIQOokQws75oJJKViZ73 YmYw8g4y94ut45cowp69U0+zPXtC75VGk8x+yysX9ks4slF4jNdjraTSR7lTZa9nz+ 3dTDOei2zSg0A== Subject: Re: [PATCH v2 1/3] ipv6: Use the selected nexthop for source address selection From: netdev-bot+sashiko@kernel.org To: tmenninger@everpuredata.com Cc: leon@kernel.org, jgg@ziepe.ca, bharat@chelsio.com, dsahern@kernel.org, idosch@nvidia.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, shuah@kernel.org, slingappa@everpuredata.com, rpatil@everpuredata.com, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 05 Dec 2026 00:37:27 +0000 Message-ID: <179643104797.3146.10807230740872201020@kernel.org> In-Reply-To: <20261203234720.2428689-2-tmenninger@everpuredata.com> References: <20261203234720.2428689-2-tmenninger@everpuredata.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] In ip6_route_get_saddr() (include/net/ip6_route.h), the new branch treats dst->dev as the device of the selected nexthop whenever… -- ipv6: Use the selected nexthop for source address selection This commit passes the dst to ip6_route_get_saddr(). For routes that use a multipath nexthop group, the source address is then picked for the device of the path the lookup selected, not for the group's first nexthop. Both ip6_dst_lookup_tail() and rt6_fill_node() are updated to pass the dst. > diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h > index 95f936be32c6c..d5754f6442bbf 100644 > --- a/include/net/ip6_route.h > +++ b/include/net/ip6_route.h [ ... ] > @@ -155,8 +156,12 @@ static inline int ip6_route_get_saddr(struct net *net, struct fib6_info *f6i, > rcu_read_lock(); > > l3mdev = dev_get_by_index_rcu(net, l3mdev_index); > - if (!f6i || !f6i->fib6_prefsrc.plen || l3mdev) > - dev = f6i ? fib6_info_nh_dev(f6i) : NULL; > + if (!f6i || !f6i->fib6_prefsrc.plen || l3mdev) { > + if (dst && f6i && f6i->nh && nexthop_is_multipath(f6i->nh)) > + dev = dst_dev_rcu(dst); [Severity: Low] Is dst->dev always the device of the selected nexthop here? For routes with RTF_LOCAL or RTF_ANYCAST set, ip6_rt_pcpu_alloc() and ip6_rt_cache_alloc() build their clones with a device from ip6_rt_get_dev_rcu(), and that function replaces the nexthop device: net/ipv6/route.c:ip6_rt_get_dev_rcu() { struct net_device *dev = res->nh->fib_nh_dev; if (res->fib6_flags & (RTF_LOCAL | RTF_ANYCAST)) { ... if (netif_is_l3_slave(dev) && !rt6_need_strict(&res->f6i->fib6_dst.addr)) dev = l3mdev_master_dev_rcu(dev) ? : dev_net(dev)->loopback_dev; else if (!netif_is_l3_master(dev)) dev = dev_net(dev)->loopback_dev; } ... } It looks like such a route can be created with RTN_LOCAL and an RTA_NH_ID that points at a multipath group. rtm_to_fib6_config() sets RTF_LOCAL, and fib6_check_nexthop() only rejects source routing, IPv4 nexthops and FDB nexthops. For that route, ip6_dst_lookup_tail() and rt6_fill_node() would now pass loopback or the VRF master to ipv6_dev_get_saddr(). Neither is the device of any nexthop in the group. Local routes with a single nexthop, or with no nexthop object, still get the real nexthop device from fib6_info_nh_dev(). For link-local or multicast destinations, or when use_oif_addrs_only is set, only the addresses of the device passed in are considered. Could this return ::1 or no usable address? In other cases, the rule 4 (outgoing interface) and VRF master preference would change. Should the new branch skip routes that have RTF_LOCAL or RTF_ANYCAST in f6i->fib6_flags? > + else > + dev = f6i ? fib6_info_nh_dev(f6i) : NULL; > + } > same_vrf = !l3mdev || l3mdev_master_dev_rcu(dev) == l3mdev; > if (f6i && f6i->fib6_prefsrc.plen && same_vrf) > *saddr = f6i->fib6_prefsrc.addr; [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203234720.2428689-1-tmenninger%40everpuredata.com