mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 17:00:08 +01:00
route-manager: fix return value of _vx_route_sync()
When the call to route_add() fails and the route is SOURCE_USER the function must return an error. Fixes:62c652c352(cherry picked from commit7364d7f8f2)
This commit is contained in:
parent
b30e7c9c61
commit
1ee9ff2cd6
1 changed files with 11 additions and 9 deletions
|
|
@ -558,16 +558,18 @@ _vx_route_sync (const VTableIP *vtable, NMRouteManager *self, int ifindex, const
|
|||
if ( !cur_plat_route
|
||||
|| route_id_cmp_result != 0
|
||||
|| !_route_equals_ignoring_ifindex (vtable, cur_plat_route, cur_ipx_route)) {
|
||||
gboolean s;
|
||||
|
||||
s = vtable->vt->route_add (NM_PLATFORM_GET, ifindex, cur_ipx_route, 0);
|
||||
if (!s && cur_ipx_route->rx.source < NM_IP_CONFIG_SOURCE_USER) {
|
||||
_LOGD (vtable->vt->addr_family, "ignore error adding IPv%c route to kernel: %s",
|
||||
vtable->vt->is_ip4 ? '4' : '6',
|
||||
vtable->vt->route_to_string (cur_ipx_route));
|
||||
/* Remember that there was a failure, but for now continue trying to sync the
|
||||
* remaining routes. */
|
||||
success = FALSE;
|
||||
if (!vtable->vt->route_add (NM_PLATFORM_GET, ifindex, cur_ipx_route, 0)) {
|
||||
if (cur_ipx_route->rx.source < NM_IP_CONFIG_SOURCE_USER) {
|
||||
_LOGD (vtable->vt->addr_family,
|
||||
"ignore error adding IPv%c route to kernel: %s",
|
||||
vtable->vt->is_ip4 ? '4' : '6',
|
||||
vtable->vt->route_to_string (cur_ipx_route));
|
||||
} else {
|
||||
/* Remember that there was a failure, but for now continue trying
|
||||
* to sync the remaining routes. */
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue