mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-21 18:24:49 +00:00
libnm-util: verify connection also for self-assignment in replace_settings_from_connection()
nm_connection_replace_settings_from_connection() would return whether the connection verifies at the end of the operation. While that is not very useful, the API is like that and cannot be changed. For consistency, also perform the verification step in case of self-assignment. Self-assigment is anyway a case that probably never happens.
This commit is contained in:
parent
bbc941245d
commit
ce6fdc3e5e
|
@ -409,7 +409,8 @@ nm_connection_replace_settings_from_connection (NMConnection *connection,
|
|||
NMConnectionPrivate *priv;
|
||||
GHashTableIter iter;
|
||||
NMSetting *setting;
|
||||
gboolean changed, valid;
|
||||
gboolean changed = FALSE;
|
||||
gboolean valid;
|
||||
|
||||
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
|
||||
g_return_val_if_fail (NM_IS_CONNECTION (new_connection), FALSE);
|
||||
|
@ -418,7 +419,7 @@ nm_connection_replace_settings_from_connection (NMConnection *connection,
|
|||
/* When 'connection' and 'new_connection' are the same object simply return
|
||||
* in order not to destroy 'connection' */
|
||||
if (connection == new_connection)
|
||||
return TRUE;
|
||||
goto out;
|
||||
|
||||
/* No need to validate permissions like nm_connection_replace_settings()
|
||||
* since we're dealing with an NMConnection which has already done that.
|
||||
|
@ -435,6 +436,7 @@ nm_connection_replace_settings_from_connection (NMConnection *connection,
|
|||
changed = TRUE;
|
||||
}
|
||||
|
||||
out:
|
||||
valid = nm_connection_verify (connection, error);
|
||||
if (changed)
|
||||
g_signal_emit (connection, signals[CHANGED], 0);
|
||||
|
|
Loading…
Reference in a new issue