From e415e4fc180b53fe2d800f9d567aac07a40571e6 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 12 Dec 2023 14:11:56 +0100 Subject: [PATCH] libnm: fix _nm_setting_property_compare_fcn_default() to use nm_g_variant_equal() nm_property_compare() makes a misguided attempt to compare dictionaries regardless of their order. However, if variants contain duplicate keys, then the implementation is wrong and cannot handle it correctly. Regardless of that. While in some sense the order of dictionary keys is irrelevant, this is not the right place to perform such normalization. If the order of things doesn't matter, then NMSetting must normalize the property (e.g. by sorting the keys). At that point, the GVariant shall be compared fully. --- src/libnm-core-impl/nm-setting.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libnm-core-impl/nm-setting.c b/src/libnm-core-impl/nm-setting.c index fdb2b1299d..455abcb95d 100644 --- a/src/libnm-core-impl/nm-setting.c +++ b/src/libnm-core-impl/nm-setting.c @@ -11,7 +11,6 @@ #include "libnm-core-intern/nm-core-internal.h" #include "libnm-glib-aux/nm-ref-string.h" #include "libnm-glib-aux/nm-secret-utils.h" -#include "nm-property-compare.h" #include "nm-setting-private.h" #include "nm-utils-private.h" #include "nm-utils.h" @@ -2653,7 +2652,7 @@ _nm_setting_property_compare_fcn_default(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm NM_CONNECTION_SERIALIZE_ALL, NULL, TRUE); - return nm_property_compare(value1, value2) == 0; + return nm_g_variant_equal(value1, value2); } }