summary refs log tree commit diff
path: root/libnm-core/nm-setting-bond.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2016-10-01 00:33:49 +0200
committerMichael Biebl <biebl@debian.org>2016-10-01 00:33:49 +0200
commit270c4830551c9810ad4e83f9a1db2b1cb946208c (patch)
tree5df09188f7e43b70896efb7b6e942e0b130d75d3 /libnm-core/nm-setting-bond.c
parent7514efc2f38c9ace4557d4e69d68e7d380389030 (diff)
New upstream version 1.4.2 upstream/1.4.2
Diffstat (limited to 'libnm-core/nm-setting-bond.c')
-rw-r--r--libnm-core/nm-setting-bond.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/libnm-core/nm-setting-bond.c b/libnm-core/nm-setting-bond.c
index a82d0d79..0364c49d 100644
--- a/libnm-core/nm-setting-bond.c
+++ b/libnm-core/nm-setting-bond.c
@@ -775,13 +775,27 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
 }
 
 static gboolean
-options_hash_match (NMSettingBond *s_bond, GHashTable *options1, GHashTable *options2)
+options_hash_match (NMSettingBond *s_bond,
+                    GHashTable *options1,
+                    GHashTable *options2,
+                    NMSettingCompareFlags flags)
 {
 	GHashTableIter iter;
 	const char *key, *value, *value2;
 
 	g_hash_table_iter_init (&iter, options1);
 	while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &value)) {
+
+		if (NM_FLAGS_HAS (flags, NM_SETTING_COMPARE_FLAG_INFERRABLE)) {
+			/* when doing an inferrable match, the active-slave should be ignored
+			 * as it might be differ from the setting in the connection.
+			 *
+			 * Also, the fail_over_mac setting can change, see for example
+			 * https://bugzilla.redhat.com/show_bug.cgi?id=1375558#c8 */
+			if (NM_IN_STRSET (key, "fail_over_mac", "active_slave"))
+				continue;
+		}
+
 		value2 = g_hash_table_lookup (options2, key);
 
 		if (!value2) {
@@ -806,10 +820,13 @@ options_hash_match (NMSettingBond *s_bond, GHashTable *options1, GHashTable *opt
 }
 
 static gboolean
-options_equal (NMSettingBond *s_bond, GHashTable *options1, GHashTable *options2)
+options_equal (NMSettingBond *s_bond,
+               GHashTable *options1,
+               GHashTable *options2,
+               NMSettingCompareFlags flags)
 {
-	return    options_hash_match (s_bond, options1, options2)
-	       && options_hash_match (s_bond, options2, options1);
+	return    options_hash_match (s_bond, options1, options2, flags)
+	       && options_hash_match (s_bond, options2, options1, flags);
 }
 
 static gboolean
@@ -823,7 +840,8 @@ compare_property (NMSetting *setting,
 	if (nm_streq0 (prop_spec->name, NM_SETTING_BOND_OPTIONS)) {
 		return options_equal (NM_SETTING_BOND (setting),
 		                      NM_SETTING_BOND_GET_PRIVATE (setting)->options,
-		                      NM_SETTING_BOND_GET_PRIVATE (other)->options);
+		                      NM_SETTING_BOND_GET_PRIVATE (other)->options,
+		                      flags);
 	}
 
 	/* Otherwise chain up to parent to handle generic compare */