summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-09-18 15:10:25 +0200
committerThomas Haller <thaller@redhat.com>2015-09-18 16:37:48 +0200
commitb1ebbf4c809c859d1ea94032ce7eb8fbf5e45d40 (patch)
tree35721a67d144e98f88d14329523c5e24b6dc8984
parentd5716eed5969fcda836cdb7055aabd835aef5cc3 (diff)
downloadNetworkManager-b1ebbf4c809c859d1ea94032ce7eb8fbf5e45d40.tar.gz
libnm: use NM_FLAGS_HAS() in nm_setting_compare()
-rw-r--r--libnm-core/nm-setting.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c
index 739e3ba2d1..4eda1e1299 100644
--- a/libnm-core/nm-setting.c
+++ b/libnm-core/nm-setting.c
@@ -31,6 +31,7 @@
#include "nm-core-internal.h"
#include "nm-utils-private.h"
#include "nm-property-compare.h"
+#include "nm-macros-internal.h"
#include "nm-setting-connection.h"
#include "nm-setting-bond.h"
@@ -1098,15 +1099,16 @@ nm_setting_compare (NMSetting *a,
GParamSpec *prop_spec = property_specs[i];
/* Fuzzy compare ignores secrets and properties defined with the FUZZY_IGNORE flag */
- if ( (flags & NM_SETTING_COMPARE_FLAG_FUZZY)
- && (prop_spec->flags & (NM_SETTING_PARAM_FUZZY_IGNORE | NM_SETTING_PARAM_SECRET)))
+ if ( NM_FLAGS_HAS (flags, NM_SETTING_COMPARE_FLAG_FUZZY)
+ && !NM_FLAGS_ANY (prop_spec->flags, NM_SETTING_PARAM_FUZZY_IGNORE | NM_SETTING_PARAM_SECRET))
continue;
- if ((flags & NM_SETTING_COMPARE_FLAG_INFERRABLE) && !(prop_spec->flags & NM_SETTING_PARAM_INFERRABLE))
+ if ( NM_FLAGS_HAS (flags, NM_SETTING_COMPARE_FLAG_INFERRABLE)
+ && !NM_FLAGS_HAS (prop_spec->flags, NM_SETTING_PARAM_INFERRABLE))
continue;
- if ( (flags & NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS)
- && (prop_spec->flags & NM_SETTING_PARAM_SECRET))
+ if ( NM_FLAGS_HAS (flags, NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS)
+ && NM_FLAGS_HAS (prop_spec->flags, NM_SETTING_PARAM_SECRET))
continue;
same = NM_SETTING_GET_CLASS (a)->compare_property (a, b, prop_spec, flags);