From 179dae7c68f447317bab2bac45c67dda463e3c51 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 26 Aug 2013 13:12:37 -0500 Subject: [PATCH] core: fix setting is_software for software devices created by NM These devices don't have a platform device at creation time, thus is_software wasn't getting set properly. Move the is_software decision to constructed() because by this point, the iface and ifindex (if present) will be known for all cases and thus we can figure out if it's a software device or not in one place. --- src/devices/nm-device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 9c21f5941..c207a08bc 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -579,6 +579,9 @@ constructed (GObject *object) priv->carrier = TRUE; } + if (priv->ifindex > 0) + priv->is_software = nm_platform_link_is_software (priv->ifindex); + if (G_OBJECT_CLASS (nm_device_parent_class)->constructed) G_OBJECT_CLASS (nm_device_parent_class)->constructed (object); } @@ -5062,7 +5065,6 @@ set_property (GObject *object, guint prop_id, g_free (priv->iface); priv->iface = g_strdup (platform_device->name); priv->ifindex = platform_device->ifindex; - priv->is_software = nm_platform_link_is_software (priv->ifindex); g_free (priv->driver); priv->driver = g_strdup (platform_device->driver); }