summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-10-10 10:20:50 +0200
committerThomas Haller <thaller@redhat.com>2019-10-10 10:20:50 +0200
commit724113c14408a71774c1ec3526d5f275af99cc07 (patch)
treed81f14c27d81561b987cce522f6a931f269cc766
parente36c297fd8c6b1b57cd120739cc5ee8eab57aa08 (diff)
downloadNetworkManager-724113c14408a71774c1ec3526d5f275af99cc07.tar.gz
libnm-core: assert that setting's compare_property() is symetric
-rw-r--r--libnm-core/nm-setting.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c
index c5b74ef812..b7be9c657f 100644
--- a/libnm-core/nm-setting.c
+++ b/libnm-core/nm-setting.c
@@ -1281,7 +1281,7 @@ _nm_setting_should_compare_secret_property (NMSetting *setting,
}
/* when @setting has the secret-flags that should be ignored,
- * we skip the comparisong if:
+ * we skip the comparison if:
*
* - @other is not present,
* - @other does not have a secret named @secret_name
@@ -1393,6 +1393,18 @@ _compare_property (const NMSettInfoSetting *sett_info,
|| NM_FLAGS_HAS (sett_info->property_infos[property_idx].param_spec->flags, NM_SETTING_PARAM_INFERRABLE)
|| compare_result == NM_TERNARY_DEFAULT);
+#if NM_MORE_ASSERTS > 10
+ /* assert that compare_property() is symeric. */
+ nm_assert ( !set_b
+ || compare_result == NM_SETTING_GET_CLASS (set_a)->compare_property (sett_info,
+ property_idx,
+ con_b,
+ set_b,
+ con_a,
+ set_a,
+ flags));
+#endif
+
return compare_result;
}