mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 22:50:08 +01:00
manager: call nm_device_realize() also for generic devices
Without that the device is not properly initialized. It misses hardware
address and type description.
Testcase:
$ sudo ip link add dummy0 type dummy
$ nmcli device
DEVICE TYPE STATE CONNECTION
em1 ethernet connected Ethernet connection 1
FF wifi connected --
bond0 bond unmanaged --
bond1 bond unmanaged --
dummy0 unmanaged --
lo unmanaged --
Fixes: e8139f56c2
This commit is contained in:
parent
e0fe47b74e
commit
28361e9238
1 changed files with 7 additions and 6 deletions
|
|
@ -1885,11 +1885,6 @@ platform_link_added (NMManager *self,
|
|||
g_clear_error (&error);
|
||||
}
|
||||
return;
|
||||
} else if (!nm_device_realize (device, plink, &error)) {
|
||||
nm_log_warn (LOGD_HW, "%s: factory failed to create device: %s",
|
||||
plink->name, error->message);
|
||||
g_clear_error (&error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1913,7 +1908,13 @@ platform_link_added (NMManager *self,
|
|||
if (device) {
|
||||
if (nm_plugin_missing)
|
||||
nm_device_set_nm_plugin_missing (device, TRUE);
|
||||
add_device (self, device, plink->type != NM_LINK_TYPE_LOOPBACK);
|
||||
if (nm_device_realize (device, plink, &error))
|
||||
add_device (self, device, plink->type != NM_LINK_TYPE_LOOPBACK);
|
||||
else {
|
||||
nm_log_warn (LOGD_HW, "%s: failed to realize device: %s",
|
||||
plink->name, error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
g_object_unref (device);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue