default-route-manager: use explict platform instance instead of NM_PLATFORM_GET singleton
authorThomas Haller <thaller@redhat.com>
Tue, 8 Mar 2016 12:42:05 +0000 (13:42 +0100)
committerThomas Haller <thaller@redhat.com>
Tue, 15 Mar 2016 11:56:58 +0000 (12:56 +0100)
src/nm-default-route-manager.c

index e2c4eef..084749e 100644 (file)
@@ -283,7 +283,7 @@ _platform_route_sync_add (const VTableIP *vtable, NMDefaultRouteManager *self, g
                return FALSE;
 
        if (vtable->vt->is_ip4) {
-               success = nm_platform_ip4_route_add (NM_PLATFORM_GET,
+               success = nm_platform_ip4_route_add (priv->platform,
                                                     entry->route.rx.ifindex,
                                                     entry->route.rx.source,
                                                     0,
@@ -293,7 +293,7 @@ _platform_route_sync_add (const VTableIP *vtable, NMDefaultRouteManager *self, g
                                                     entry->effective_metric,
                                                     entry->route.rx.mss);
        } else {
-               success = nm_platform_ip6_route_add (NM_PLATFORM_GET,
+               success = nm_platform_ip6_route_add (priv->platform,
                                                     entry->route.rx.ifindex,
                                                     entry->route.rx.source,
                                                     in6addr_any,
@@ -319,7 +319,7 @@ _platform_route_sync_flush (const VTableIP *vtable, NMDefaultRouteManager *self,
        gboolean changed = FALSE;
 
        /* prune all other default routes from this device. */
-       routes = vtable->vt->route_get_all (NM_PLATFORM_GET, 0, NM_PLATFORM_GET_ROUTE_FLAGS_WITH_DEFAULT);
+       routes = vtable->vt->route_get_all (priv->platform, 0, NM_PLATFORM_GET_ROUTE_FLAGS_WITH_DEFAULT);
 
        for (i = 0; i < routes->len; i++) {
                const NMPlatformIPRoute *route;
@@ -351,7 +351,7 @@ _platform_route_sync_flush (const VTableIP *vtable, NMDefaultRouteManager *self,
                 */
                if (   !entry
                    && (has_ifindex_synced || ifindex_to_flush == route->ifindex)) {
-                       vtable->vt->route_delete_default (NM_PLATFORM_GET, route->ifindex, route->metric);
+                       vtable->vt->route_delete_default (priv->platform, route->ifindex, route->metric);
                        changed = TRUE;
                }
        }
@@ -505,7 +505,7 @@ _resync_all (const VTableIP *vtable, NMDefaultRouteManager *self, const Entry *c
 
        entries = vtable->get_entries (priv);
 
-       routes = vtable->vt->route_get_all (NM_PLATFORM_GET, 0, NM_PLATFORM_GET_ROUTE_FLAGS_WITH_DEFAULT);
+       routes = vtable->vt->route_get_all (priv->platform, 0, NM_PLATFORM_GET_ROUTE_FLAGS_WITH_DEFAULT);
 
        assumed_metrics = _get_assumed_interface_metrics (vtable, self, routes);