seg6: Extend seg6_lookup_any_nexthop() with an oif argument
authorIdo Schimmel <idosch@nvidia.com>
Thu, 12 Jun 2025 12:23:20 +0000 (15:23 +0300)
committerJakub Kicinski <kuba@kernel.org>
Mon, 16 Jun 2025 22:31:14 +0000 (15:31 -0700)
commit01c411238c06e07ea5fa038f0ba9eaca8a53c419
tree58345c453abefd93b37ff7bd98ef5928625887b4
parent0550890b2f80697e7ebf1e4916373e884a921492
seg6: Extend seg6_lookup_any_nexthop() with an oif argument

seg6_lookup_any_nexthop() is called by the different endpoint behaviors
(e.g., End, End.X) to resolve an IPv6 route. Extend the function with an
output interface argument so that it could be used to resolve a route
with a certain output interface. This will be used by subsequent patches
that will extend the End.X behavior with an output interface as an
optional argument.

ip6_route_input_lookup() cannot be used when an output interface is
specified as it ignores this parameter. Similarly, calling
ip6_pol_route() when a table ID was not specified (e.g., End.X behavior)
is wrong.

Therefore, when an output interface is specified without a table ID,
resolve the route using ip6_route_output() which will take the output
interface into account.

Note that no endpoint behavior currently passes both a table ID and an
output interface, so the oif argument passed to ip6_pol_route() is
always zero and there are no functional changes in this regard.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Link: https://patch.msgid.link/20250612122323.584113-2-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/seg6_local.c