mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-28 01:20:24 +01:00
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:388b7830f3(cherry picked from commit7572837375)
This commit is contained in:
parent
6c67406b41
commit
ac99f69809
1 changed files with 6 additions and 6 deletions
|
|
@ -4429,15 +4429,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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue