manager: make generic devices compatible with all link types

If a generic device is present and the name matches, it is compatible
with any link type.

For example, if a generic connection has a device-handler that creates
a dummy interface, the link is compatible with the NMDeviceGeneric.
This commit is contained in:
Beniamino Galvani 2023-10-02 15:19:48 +02:00
parent f2613be150
commit 5978fb2b27

View file

@ -4168,8 +4168,11 @@ platform_link_added(NMManager *self,
gboolean compatible = TRUE;
gs_free_error GError *error = NULL;
if (nm_device_get_link_type(candidate) != plink->type)
if (nm_device_get_device_type(candidate) == NM_DEVICE_TYPE_GENERIC) {
/* generic devices are compatible with all link types */
} else if (nm_device_get_link_type(candidate) != plink->type) {
continue;
}
if (!nm_streq(nm_device_get_iface(candidate), plink->name))
continue;