diff --git a/libfwupdplugin/fu-udev-device.c b/libfwupdplugin/fu-udev-device.c index 7f77f89f9..b4e708f3a 100644 --- a/libfwupdplugin/fu-udev-device.c +++ b/libfwupdplugin/fu-udev-device.c @@ -464,13 +464,28 @@ fu_udev_device_set_dev (FuUdevDevice *self, GUdevDevice *udev_device) FuUdevDevicePrivate *priv = GET_PRIVATE (self); #ifdef HAVE_GUDEV const gchar *summary; - g_autoptr(GUdevDevice) parent = NULL; #endif g_return_if_fail (FU_IS_UDEV_DEVICE (self)); - /* set new device */ +#ifdef HAVE_GUDEV + /* the net subsystem is not a real hardware class */ + if (udev_device != NULL && + g_strcmp0 (g_udev_device_get_subsystem (udev_device), "net") == 0) { + g_autoptr(GUdevDevice) udev_device_phys = NULL; + udev_device_phys = g_udev_device_get_parent (udev_device); + g_set_object (&priv->udev_device, udev_device_phys); + fu_device_set_metadata (FU_DEVICE (self), + "ParentSubsystem", + g_udev_device_get_subsystem (udev_device)); + } else { + g_set_object (&priv->udev_device, udev_device); + } +#else g_set_object (&priv->udev_device, udev_device); +#endif + + /* set new device */ if (priv->udev_device == NULL) return; #ifdef HAVE_GUDEV @@ -480,6 +495,7 @@ fu_udev_device_set_dev (FuUdevDevice *self, GUdevDevice *udev_device) /* try to get one line summary */ summary = g_udev_device_get_sysfs_attr (priv->udev_device, "description"); if (summary == NULL) { + g_autoptr(GUdevDevice) parent = NULL; parent = g_udev_device_get_parent (priv->udev_device); if (parent != NULL) summary = g_udev_device_get_sysfs_attr (parent, "description");