From 7572837375d6eed2833eb5144fc8f9221c57eedf Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 4 May 2015 17:22:00 +0200 Subject: [PATCH] platform: keep udev-device in udev_device_added() even if there is no netlink object Throwing away the udev_device instance is wrong. There are two cases: - the udev-device appears, and the netlink object will never appear (or is already gone). In this case, keeping the udev-device is ok because we will eventually get a signal from UDev to cleanup the device instance. - the udev-device appears before the netlink object. In this case we want to keep the udev instance to have it ready. Fixes: 388b7830f322b60960884328ff51f7b4df0ef3d3 --- src/platform/nm-linux-platform.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index abbaa06a7f..629a05cb04 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -4439,15 +4439,15 @@ udev_device_added (NMPlatform *platform, return; } - rtnllink = rtnl_link_get (priv->link_cache, ifindex); - if (!rtnllink) { - warning ("(%s): udev-add: interface not known via netlink; ignoring...", ifname); - return; - } - g_hash_table_insert (priv->udev_devices, GINT_TO_POINTER (ifindex), g_object_ref (udev_device)); + rtnllink = rtnl_link_get (priv->link_cache, ifindex); + if (!rtnllink) { + debug ("(%s): udev-add: interface not known via netlink; ignoring ifindex %d...", ifname, ifindex); + return; + } + announce_object (platform, (struct nl_object *) rtnllink, NM_PLATFORM_SIGNAL_CHANGED, NM_PLATFORM_REASON_EXTERNAL); }