Message ID | 20220713114853.29406-1-nicolas.dichtel@6wind.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 747c14307214b55dbd8250e1ab44cad8305756f1 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v3,1/2] ip: fix dflt addr selection for connected nexthop | expand |
Hello: This series was applied to netdev/net.git (master) by Paolo Abeni <pabeni@redhat.com>: On Wed, 13 Jul 2022 13:48:52 +0200 you wrote: > When a nexthop is added, without a gw address, the default scope was set > to 'host'. Thus, when a source address is selected, 127.0.0.1 may be chosen > but rejected when the route is used. > > When using a route without a nexthop id, the scope can be configured in the > route, thus the problem doesn't exist. > > [...] Here is the summary with links: - [net,v3,1/2] ip: fix dflt addr selection for connected nexthop https://git.kernel.org/netdev/net/c/747c14307214 - [net,v3,2/2] selftests/net: test nexthop without gw https://git.kernel.org/netdev/net/c/cd72e61bad14 You are awesome, thank you!
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index a57ba23571c9..20177ecf5bdd 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -1230,7 +1230,7 @@ static int fib_check_nh_nongw(struct net *net, struct fib_nh *nh, nh->fib_nh_dev = in_dev->dev; dev_hold_track(nh->fib_nh_dev, &nh->fib_nh_dev_tracker, GFP_ATOMIC); - nh->fib_nh_scope = RT_SCOPE_HOST; + nh->fib_nh_scope = RT_SCOPE_LINK; if (!netif_carrier_ok(nh->fib_nh_dev)) nh->fib_nh_flags |= RTNH_F_LINKDOWN; err = 0;