mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 19:10:09 +01:00
core/utils: assert that completion results in a valid connection
Completion of a connection must always result in a valid connection and the call to normalize() is always expected to succeed here. Croak if it doesn't because the rest basically relies on the connection being normalized. If it's not valid, and can't be normalized, it's a bug.
This commit is contained in:
parent
6e52a8ab9e
commit
a93dbf95bd
1 changed files with 3 additions and 1 deletions
|
|
@ -267,6 +267,7 @@ _nm_utils_complete_generic_with_params(NMPlatform *platform,
|
|||
va_list ap;
|
||||
const char *p_val;
|
||||
const char *p_key;
|
||||
gboolean valid;
|
||||
|
||||
g_assert(fallback_id_prefix);
|
||||
g_return_if_fail(ifname_prefix == NULL || ifname == NULL);
|
||||
|
|
@ -315,7 +316,8 @@ _nm_utils_complete_generic_with_params(NMPlatform *platform,
|
|||
g_hash_table_insert(parameters, (char *) p_key, (char *) p_val);
|
||||
}
|
||||
va_end(ap);
|
||||
nm_connection_normalize(connection, parameters, NULL, NULL);
|
||||
valid = nm_connection_normalize(connection, parameters, NULL, NULL);
|
||||
nm_assert(valid);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue