diff options
Diffstat (limited to 'src/nm-default-route-manager.c')
-rw-r--r-- | src/nm-default-route-manager.c | 55 |
1 files changed, 24 insertions, 31 deletions
diff --git a/src/nm-default-route-manager.c b/src/nm-default-route-manager.c index af3de0dfc0..91114fd6a9 100644 --- a/src/nm-default-route-manager.c +++ b/src/nm-default-route-manager.c @@ -1332,33 +1332,6 @@ _resync_idle_reschedule (NMDefaultRouteManager *self) } static void -_platform_ipx_route_changed_cb (const VTableIP *vtable, - NMDefaultRouteManager *self, - const NMPlatformIPRoute *route) -{ - NMDefaultRouteManagerPrivate *priv; - - if (route && !NM_PLATFORM_IP_ROUTE_IS_DEFAULT (route)) { - /* we only care about address changes or changes of default route. */ - return; - } - - priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self); - - if (priv->resync.guard) { - /* callbacks while executing _resync_all() are ignored. */ - return; - } - - if (vtable->vt->is_ip4) - priv->resync.has_v4_changes = TRUE; - else - priv->resync.has_v6_changes = TRUE; - - _resync_idle_reschedule (self); -} - -static void _platform_changed_cb (NMPlatform *platform, int obj_type_i, int ifindex, @@ -1366,24 +1339,44 @@ _platform_changed_cb (NMPlatform *platform, int change_type_i, NMDefaultRouteManager *self) { + NMDefaultRouteManagerPrivate *priv; const NMPObjectType obj_type = obj_type_i; + const VTableIP *vtable; switch (obj_type) { case NMP_OBJECT_TYPE_IP4_ADDRESS: - _platform_ipx_route_changed_cb (&vtable_ip4, self, NULL); + vtable = &vtable_ip4; break; case NMP_OBJECT_TYPE_IP6_ADDRESS: - _platform_ipx_route_changed_cb (&vtable_ip6, self, NULL); + vtable = &vtable_ip6; break; case NMP_OBJECT_TYPE_IP4_ROUTE: - _platform_ipx_route_changed_cb (&vtable_ip4, self, (const NMPlatformIPRoute *) platform_object); + if (!NM_PLATFORM_IP_ROUTE_IS_DEFAULT (platform_object)) + return; + vtable = &vtable_ip4; break; case NMP_OBJECT_TYPE_IP6_ROUTE: - _platform_ipx_route_changed_cb (&vtable_ip6, self, (const NMPlatformIPRoute *) platform_object); + if (!NM_PLATFORM_IP_ROUTE_IS_DEFAULT (platform_object)) + return; + vtable = &vtable_ip6; break; default: g_return_if_reached (); } + + priv = NM_DEFAULT_ROUTE_MANAGER_GET_PRIVATE (self); + + if (priv->resync.guard) { + /* callbacks while executing _resync_all() are ignored. */ + return; + } + + if (vtable->vt->is_ip4) + priv->resync.has_v4_changes = TRUE; + else + priv->resync.has_v6_changes = TRUE; + + _resync_idle_reschedule (self); } /*****************************************************************************/ |