summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2015-06-26 13:34:06 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2015-06-26 16:37:59 +0200
commit7364d7f8f228272f2fa39a952973f635ae5f5191 (patch)
treeafd94b63349f785511d061bad3bfc50ab90a76e2
parentf5cc6da8cf73eb4e3ebfac80a96733e8081e8bcf (diff)
downloadNetworkManager-7364d7f8f228272f2fa39a952973f635ae5f5191.tar.gz
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: 62c652c3520e5427952dd0788eb56d7043fdc6b7
-rw-r--r--src/nm-route-manager.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/nm-route-manager.c b/src/nm-route-manager.c
index bb4b9ea117..3e1d5b5bd8 100644
--- a/src/nm-route-manager.c
+++ b/src/nm-route-manager.c
@@ -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;
+ }
}
}
}