mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 11:10:09 +01:00
libnm: fix compare_property() to handle default values
Before, get_property_for_dbus() would @ignore_defaults.
That is for example wrong for properties of type G_TYPE_STRV.
In this case, if one operand has the property at its default
(NULL) and the other has it to an empty string list, both would
compare equal.
This has the effect that different settings might compare equal.
(cherry picked from commit 7478c4b54a)
This commit is contained in:
parent
217c012595
commit
6861cd1f2b
1 changed files with 6 additions and 4 deletions
|
|
@ -1053,13 +1053,15 @@ compare_property (NMSetting *setting,
|
|||
property = nm_setting_class_find_property (NM_SETTING_GET_CLASS (setting), prop_spec->name);
|
||||
g_return_val_if_fail (property != NULL, FALSE);
|
||||
|
||||
value1 = get_property_for_dbus (setting, property, FALSE);
|
||||
value2 = get_property_for_dbus (other, property, FALSE);
|
||||
value1 = get_property_for_dbus (setting, property, TRUE);
|
||||
value2 = get_property_for_dbus (other, property, TRUE);
|
||||
|
||||
cmp = nm_property_compare (value1, value2);
|
||||
|
||||
g_variant_unref (value1);
|
||||
g_variant_unref (value2);
|
||||
if (value1)
|
||||
g_variant_unref (value1);
|
||||
if (value2)
|
||||
g_variant_unref (value2);
|
||||
|
||||
return cmp == 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue