summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2023-10-02 15:19:48 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2024-02-21 11:16:06 +0100
commit5978fb2b27cdda8f119735bf51bee1942f6921f7 (patch)
treee7d2ad00605667ba5ca2424bfbc576022f7bce5e
parentf2613be150ed10e651b4273ddddccd914cb866da (diff)
manager: make generic devices compatible with all link typesbg/create-generic-devices
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.
-rw-r--r--src/core/nm-manager.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c
index 9284ae8c43..730ba4763b 100644
--- a/src/core/nm-manager.c
+++ b/src/core/nm-manager.c
@@ -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;