From 5f93f0101538db39efe0f9ea2316e63bff953bf0 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 4 Jan 2016 14:18:02 +0100 Subject: [PATCH 1/2] ppp-manager: clear @ppp_watch_id upon pppd termination Set @ppp_watch_id to zero upon pppd termination, otherwise the call to g_source_remove(priv->ppp_watch_id) in dispose() could trigger a failed assertion. --- src/ppp-manager/nm-ppp-manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c index ddf4c1e5da..49f7075347 100644 --- a/src/ppp-manager/nm-ppp-manager.c +++ b/src/ppp-manager/nm-ppp-manager.c @@ -800,6 +800,7 @@ ppp_watch_cb (GPid pid, gint status, gpointer user_data) nm_log_dbg (LOGD_PPP, "pppd pid %d cleaned up", priv->pid); priv->pid = 0; + priv->ppp_watch_id = 0; g_signal_emit (manager, signals[STATE_CHANGED], 0, NM_PPP_STATUS_DEAD); } From ed536998f9530698ff3082fc5587dbeb7d3a594f Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 4 Jan 2016 14:22:01 +0100 Subject: [PATCH 2/2] device: update @ip_iface only if IP interface exists If @ip_ifindex is zero, the IP interface has disappeared and there's no point in updating @ip_iface. Actually, unconditionally updating @ip_iface is dangerous because it breaks the assumption used by other functions (as nm_device_get_ip_ifindex()) that a non-NULL @ip_iface implies a valid @ip_ifindex. This was causing the scary failure: devices/nm-device.c:666:get_ip_iface_identifier: assertion failed: (ifindex) https://bugzilla.redhat.com/show_bug.cgi?id=1268617 --- src/devices/nm-device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 0aa7650891..8c0a599bc8 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -1601,12 +1601,13 @@ device_ip_link_changed (NMDevice *self) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); const NMPlatformLink *pllink; - int ip_ifindex; priv->device_ip_link_changed_id = 0; - ip_ifindex = nm_device_get_ip_ifindex (self); - pllink = nm_platform_link_get (NM_PLATFORM_GET, ip_ifindex); + if (!priv->ip_ifindex) + return G_SOURCE_REMOVE; + + pllink = nm_platform_link_get (NM_PLATFORM_GET, priv->ip_ifindex); if (!pllink) return G_SOURCE_REMOVE;