mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-14 04:20:21 +01:00
core: prevent the activation of unavailable devices
When autoconnecting ports of a controller, we look for all candidate
(device,connection) tuples through the following call trace:
-> autoconnect_ports()
-> find_ports()
-> nm_manager_get_best_device_for_connection()
-> nm_device_check_connection_available()
-> _nm_device_check_connection_available()
The last function checks that a specific device is available to be
activated with the given connection. For virtual devices, it only
checks that the device is compatible with the connection based on the
device type and characteristics, without considering any live network
information.
For OVS interfaces, this doesn't work as expected. During startup, NM
performs a cleanup of the ovsdb to remove entries that were previously
added by NM. When the cleanup is terminated, NMOvsdb sets the "ready"
flag and is ready to start the activation of new OVS interfaces. With
the current mechanism, it is possible that a OVS-interface connection
gets activated via the autoconnect-ports mechanism without checking
the "ready" flag.
Fix that by also checking that the device is available for activation.
(cherry picked from commit 774badb151)
(cherry picked from commit f459c7fecc)
(cherry picked from commit b495d6bd55)
This commit is contained in:
parent
c4bce742f1
commit
21cff68a8a
1 changed files with 6 additions and 0 deletions
|
|
@ -4699,6 +4699,12 @@ found_better:
|
|||
if (nm_g_hash_table_contains(exclude_devices, device))
|
||||
continue;
|
||||
|
||||
if (!nm_device_is_available(device,
|
||||
for_user_request
|
||||
? NM_DEVICE_CHECK_DEV_AVAILABLE_FOR_USER_REQUEST
|
||||
: NM_DEVICE_CHECK_DEV_AVAILABLE_NONE))
|
||||
continue;
|
||||
|
||||
/* determine the priority of this device. Currently, this priority is independent
|
||||
* of the profile (connection) and the device's details (aside the state).
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue