From 7b9a9352c2bc530eba39e8a00631454dfec4d878 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 24 Jan 2023 14:46:17 +0100 Subject: [PATCH] manager: relax check when creating virtual devices For each connection that corresponds to a software device, we create a "unrealized" device that then becomes realized just before the connection starts activating. Currently, in certain conditions NM creates two devices with the same name and type, one realized and one not; this is not expected and can lead to other issues especially when a software device is reactivated. Avoid that by relaxing the check in system_create_virtual_device(): if a device exists with the same name and type, we don't want to create another even if the type-specific parameters differ. --- src/core/nm-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c index a4612ffdde..d04aa18b25 100644 --- a/src/core/nm-manager.c +++ b/src/core/nm-manager.c @@ -2549,7 +2549,7 @@ system_create_virtual_device(NMManager *self, NMConnection *connection) /* See if there's a device that is already compatible with this connection */ c_list_for_each_entry (dev_candidate, &priv->devices_lst_head, devices_lst) { - if (nm_device_check_connection_compatible(dev_candidate, connection, TRUE, NULL)) { + if (nm_device_check_connection_compatible(dev_candidate, connection, FALSE, NULL)) { if (nm_device_is_real(dev_candidate)) { _LOG3D(LOGD_DEVICE, connection, "already created virtual interface name %s", iface); return NULL;