From 4182deb3989fbf466a78ccf2d1bf29714f902d19 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 18 Jun 2013 14:41:26 -0500 Subject: [PATCH] core: remove possibly dangling idle handler in ip6 manager If things happen just right, where a bond is the first device to use IPv6 and thus has the only reference to the NMIP6Manager, and the RTM_NEWROUTE event comes in and triggers manager_request_ip6_info() but then the device is removed by 'rmmod bonding', the call to manager_request_ip6_info() could be dangling after the IP6Manager has been disposed. Fix that. --- src/ip6-manager/nm-ip6-manager.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 77a491f628..999706e8d8 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -1311,9 +1311,8 @@ manager_request_ip6_info (gpointer user_data) NMIP6Manager *manager = user_data; NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); - nm_netlink_monitor_request_ip6_info (priv->monitor, NULL); - priv->request_ip6_info_id = 0; + nm_netlink_monitor_request_ip6_info (priv->monitor, NULL); return FALSE; } @@ -1651,6 +1650,9 @@ finalize (GObject *object) { NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (object); + if (priv->request_ip6_info_id) + g_source_remove (priv->request_ip6_info_id); + g_signal_handler_disconnect (priv->monitor, priv->netlink_id); g_hash_table_destroy (priv->devices);