diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2022-09-26 16:17:45 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2022-09-26 16:17:45 +0200 |
commit | e1b8ab90de5a89df1abffc1b8c814aee3efe923e (patch) | |
tree | e0d0f4ee7ea9fdd09c3d281707afe116b0bf0ee3 | |
parent | ee0f3f6242acd801dbad0f6f77424c7a753df3be (diff) | |
parent | ed29863645a487bdbe55c1ec2fbc74df2662e50f (diff) |
merge: branch 'bg/rh2101317'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1374
-rw-r--r-- | src/core/nm-manager.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c index 5bfefb7bcc..ea71af3370 100644 --- a/src/core/nm-manager.c +++ b/src/core/nm-manager.c @@ -1887,8 +1887,11 @@ find_parent_device_for_connection(NMManager *self, * with some known device. */ c_list_for_each_entry (candidate, &priv->devices_lst_head, devices_lst) { - /* Unmanaged devices are not compatible with any connection */ - if (!nm_device_get_managed(candidate, FALSE)) + /* For a realized device, check that it's managed; otherwise it's not + * compatible with any connection. If the device is unrealized then + * the managed state is meaningless. + */ + if (nm_device_is_real(candidate) && !nm_device_get_managed(candidate, FALSE)) continue; if (nm_device_get_settings_connection(candidate) == parent_connection) @@ -4710,8 +4713,10 @@ find_slaves(NMManager *manager, } nm_assert(n_slaves < n_all_connections); - slaves[n_slaves].connection = candidate, slaves[n_slaves].device = slave_device, - n_slaves++; + slaves[n_slaves++] = (SlaveConnectionInfo){ + .connection = candidate, + .device = slave_device, + }; if (slave_device) g_hash_table_add(devices, slave_device); |