mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 04:40:09 +01:00
manager: check that slaves connection have a compatible device
When slave connections are autoactivated as dependency to master we don't check if a compatible device is available before trying to activate them, leading to the following failed assertion: nm_act_request_new: assertion 'NM_IS_DEVICE (device)' failed
This commit is contained in:
parent
6e1616ba69
commit
52b1f0415d
1 changed files with 16 additions and 1 deletions
|
|
@ -2947,6 +2947,7 @@ autoconnect_slaves (NMManager *self,
|
|||
while (iter) {
|
||||
NMSettingsConnection *slave_connection = iter->data;
|
||||
const char *uuid;
|
||||
NMDevice *slave_device;
|
||||
|
||||
iter = iter->next;
|
||||
|
||||
|
|
@ -2974,6 +2975,20 @@ autoconnect_slaves (NMManager *self,
|
|||
g_strdup (uuid),
|
||||
g_free);
|
||||
|
||||
slave_device = nm_manager_get_best_device_for_connection (self,
|
||||
NM_CONNECTION (slave_connection),
|
||||
FALSE);
|
||||
if (!slave_device) {
|
||||
_LOGD (LOGD_CORE,
|
||||
"will NOT activate slave connection '%s' (%s) as a dependency for master '%s' (%s): "
|
||||
"no compatible device found",
|
||||
nm_settings_connection_get_id (slave_connection),
|
||||
nm_settings_connection_get_uuid (slave_connection),
|
||||
nm_settings_connection_get_id (master_connection),
|
||||
nm_settings_connection_get_uuid (master_connection));
|
||||
continue;
|
||||
}
|
||||
|
||||
_LOGD (LOGD_CORE, "will activate slave connection '%s' (%s) as a dependency for master '%s' (%s)",
|
||||
nm_settings_connection_get_id (slave_connection),
|
||||
nm_settings_connection_get_uuid (slave_connection),
|
||||
|
|
@ -2985,7 +3000,7 @@ autoconnect_slaves (NMManager *self,
|
|||
slave_connection,
|
||||
NULL,
|
||||
NULL,
|
||||
nm_manager_get_best_device_for_connection (self, NM_CONNECTION (slave_connection), FALSE),
|
||||
slave_device,
|
||||
subject,
|
||||
NM_ACTIVATION_TYPE_MANAGED,
|
||||
&local_err);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue