libnm-util: bugfix wrong diff result in nm_connection_diff
Commit 6abc7b78f6
introduced a
bug in nm_connection_diff() by not reading the property value with
g_object_get_property().
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
@@ -688,7 +688,6 @@ nm_setting_diff (NMSetting *a,
|
|||||||
|
|
||||||
for (i = 0; i < n_property_specs; i++) {
|
for (i = 0; i < n_property_specs; i++) {
|
||||||
GParamSpec *prop_spec = property_specs[i];
|
GParamSpec *prop_spec = property_specs[i];
|
||||||
GValue a_value = G_VALUE_INIT, b_value = G_VALUE_INIT;
|
|
||||||
NMSettingDiffResult r = NM_SETTING_DIFF_RESULT_UNKNOWN, tmp;
|
NMSettingDiffResult r = NM_SETTING_DIFF_RESULT_UNKNOWN, tmp;
|
||||||
gboolean different = TRUE;
|
gboolean different = TRUE;
|
||||||
|
|
||||||
@@ -701,16 +700,19 @@ nm_setting_diff (NMSetting *a,
|
|||||||
if (b) {
|
if (b) {
|
||||||
different = !NM_SETTING_GET_CLASS (a)->compare_property (a, b, prop_spec, flags);
|
different = !NM_SETTING_GET_CLASS (a)->compare_property (a, b, prop_spec, flags);
|
||||||
if (different) {
|
if (different) {
|
||||||
g_value_init (&a_value, prop_spec->value_type);
|
GValue value = G_VALUE_INIT;
|
||||||
g_value_init (&b_value, prop_spec->value_type);
|
|
||||||
|
|
||||||
if (!g_param_value_defaults (prop_spec, &a_value))
|
g_value_init (&value, prop_spec->value_type);
|
||||||
|
g_object_get_property (G_OBJECT (a), prop_spec->name, &value);
|
||||||
|
if (!g_param_value_defaults (prop_spec, &value))
|
||||||
r |= a_result;
|
r |= a_result;
|
||||||
if (!g_param_value_defaults (prop_spec, &b_value))
|
|
||||||
|
g_value_reset (&value);
|
||||||
|
g_object_get_property (G_OBJECT (b), prop_spec->name, &value);
|
||||||
|
if (!g_param_value_defaults (prop_spec, &value))
|
||||||
r |= b_result;
|
r |= b_result;
|
||||||
|
|
||||||
g_value_unset (&a_value);
|
g_value_unset (&value);
|
||||||
g_value_unset (&b_value);
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
r = a_result; /* only in A */
|
r = a_result; /* only in A */
|
||||||
|
Reference in New Issue
Block a user