summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2020-11-27 19:31:22 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2020-11-30 14:43:22 +0100
commitd0df9bf0bd982ebf3dd9cf34dc240bf517012ff8 (patch)
treed95f941385c0177ccc33a6783934a0b4e2b32318
parent587a1949b227539efb5449808316172cada37cee (diff)
downloadNetworkManager-bg/ac-order.tar.gz
manager: return most recent connection in active_connection_find()bg/ac-order
When a connection is reactivated, there could be two active connections tracked by the manager: the deactivating one and the new one. Ensure that we first return the most recent one so that slaves will pick the right master. Fixes-test: @iptunnel_gretap_doc_procedure Fixes: dc6ec6ce7b8d ('core: reverse the order of active connections in the manager') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/697
-rw-r--r--src/nm-manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 75117bbc63..03906c8435 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -987,7 +987,7 @@ active_connection_find(
nm_assert(!sett_conn || NM_IS_SETTINGS_CONNECTION(sett_conn));
nm_assert(!out_all_matching || !*out_all_matching);
- c_list_for_each_entry (ac, &priv->active_connections_lst_head, active_connections_lst) {
+ c_list_for_each_entry_prev (ac, &priv->active_connections_lst_head, active_connections_lst) {
NMSettingsConnection *ac_conn;
ac_conn = nm_active_connection_get_settings_connection(ac);