]> git.baikalelectronics.ru Git - kernel.git/commit
nh: fix scope used to find saddr when adding non gw nh
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 20 Oct 2022 10:09:52 +0000 (12:09 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 27 Oct 2022 17:17:40 +0000 (10:17 -0700)
commit10da7f2b809649cb688f05eec7540099a330d641
tree8c3e02c388dcfbb1897d59647327f49c7a5b56f3
parent5450763f3e920b940f457dc04fc0895edded779a
nh: fix scope used to find saddr when adding non gw nh

As explained by Julian, fib_nh_scope is related to fib_nh_gw4, but
fib_info_update_nhc_saddr() needs the scope of the route, which is
the scope "before" fib_nh_scope, ie fib_nh_scope - 1.

This patch fixes the problem described in commit 4be009aa4a33 ("ip: fix
dflt addr selection for connected nexthop").

Fixes: 4b16068d4069 ("nexthop: Add support for IPv4 nexthops")
Link: https://lore.kernel.org/netdev/6c8a44ba-c2d5-cdf-c5c7-5baf97cba38@ssi.bg/
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/nexthop.c