diff options
Diffstat (limited to 'src/devices/nm-device.c')
-rw-r--r-- | src/devices/nm-device.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 501f17c339..a5afdfd75b 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -7845,6 +7845,9 @@ constructor (GType type, if (NM_DEVICE_GET_CLASS (self)->get_generic_capabilities) priv->capabilities |= NM_DEVICE_GET_CLASS (self)->get_generic_capabilities (self); + if (priv->ifindex <= 0 && !device_has_capability (self, NM_DEVICE_CAP_IS_NON_KERNEL)) + _LOGW (LOGD_HW, "failed to look up interface index"); + device_get_driver_info (self, priv->iface, &priv->driver_version, &priv->firmware_version); /* Watch for external IP config changes */ @@ -8043,18 +8046,8 @@ set_property (GObject *object, guint prop_id, case PROP_IFACE: if (g_value_get_string (value)) { g_free (priv->iface); - priv->ifindex = 0; priv->iface = g_value_dup_string (value); - - /* Only look up the ifindex if it appears to be an actual kernel - * interface name. eg Bluetooth devices won't have one until we know - * the IP interface. - */ - if (priv->iface && !strchr (priv->iface, ':')) { - priv->ifindex = nm_platform_link_get_ifindex (priv->iface); - if (priv->ifindex <= 0) - _LOGW (LOGD_HW, "failed to look up interface index"); - } + priv->ifindex = nm_platform_link_get_ifindex (priv->iface); } break; case PROP_DRIVER: |