From 722ce46aaaf8b315174eb5efad0a1716675cf609 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 24 Aug 2012 12:02:31 -0500 Subject: [PATCH] core: ignore PPP interface removal signals from udev PPP interfaces are transient and created by their master interface (usually for PPPoE or WWAN) and thus we don't want their removal to affect their master device. Unfortunately, that was happening when a manual 'killall -TERM pppd' was run, which caused the udev device removal signal, which caused NM to remove the master WWAN device when udev signaled that the 'ppp' interface was gone. --- src/nm-manager.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index f2816cd7ab..22c3bd43ec 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2123,6 +2123,14 @@ udev_device_removed_cb (NMUdevManager *manager, NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); NMDevice *device; guint32 ifindex; + const char *iface = g_udev_device_get_name (udev_device); + + /* Ignore PPP interfaces as they are the IP interface of a device, + * but they come and go when the device gets activated or deactivated. + * We don't want their transient nature to affect their master device. + */ + if (strncmp (iface, "ppp", 3) == 0) + return; ifindex = g_udev_device_get_property_as_int (udev_device, "IFINDEX"); device = find_device_by_ifindex (self, ifindex); @@ -2131,7 +2139,7 @@ udev_device_removed_cb (NMUdevManager *manager, * they may have already been removed from sysfs. Instead, we just * have to fall back to the device's interface name. */ - device = find_device_by_ip_iface (self, g_udev_device_get_name (udev_device)); + device = find_device_by_ip_iface (self, iface); } if (device)