mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 21:50:18 +01:00
platform: skip metric-0 IPv6 routes in nm_platform_ip_route_sync()
@routes are the list of routes we want to configure. This contains routes from DHCP and manual routes in the profile. It also contains externally present routes, including the metric=0 routes in the local table. Trying to add an IPv6 route with metric zero adds instead a route with metric 1024. Usually, we wouldn't do that, because that route was present externally, so it possibly is still present (in the platform cache) during sync and we skip the addition. However, there is a race where the external route might just disappear and we'd add a route with metric 1024. Avoid that.
This commit is contained in:
parent
5830694fe3
commit
a83622f7d0
1 changed files with 7 additions and 0 deletions
|
|
@ -4323,6 +4323,13 @@ nm_platform_ip_route_sync (NMPlatform *self,
|
|||
continue;
|
||||
}
|
||||
|
||||
if ( !IS_IPv4
|
||||
&& NMP_OBJECT_CAST_IP6_ROUTE (conf_o)->metric == 0) {
|
||||
/* User space cannot add routes with metric 0. However, kernel can, and we might track such
|
||||
* routes in @route as they are present external. Skip them silently. */
|
||||
continue;
|
||||
}
|
||||
|
||||
plat_entry = nm_platform_lookup_entry (self,
|
||||
NMP_CACHE_ID_TYPE_OBJECT_TYPE,
|
||||
conf_o);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue