diff --git a/libnm-core/nm-setting-bond.c b/libnm-core/nm-setting-bond.c index f53f2c8cf2..652d55487b 100644 --- a/libnm-core/nm-setting-bond.c +++ b/libnm-core/nm-setting-bond.c @@ -1033,7 +1033,7 @@ options_equal_asym (NMSettingBond *s_bond, NMSettingCompareFlags flags) { GHashTableIter iter; - const char *key, *value, *value2; + const char *key, *value; g_hash_table_iter_init (&iter, NM_SETTING_BOND_GET_PRIVATE (s_bond)->options); while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &value)) { @@ -1048,18 +1048,7 @@ options_equal_asym (NMSettingBond *s_bond, continue; } - value2 = _bond_get_option (s_bond2, key); - - if (!value2) { - if (nm_streq (key, "num_grat_arp")) - value2 = _bond_get_option (s_bond2, "num_unsol_na"); - else if (nm_streq (key, "num_unsol_na")) - value2 = _bond_get_option (s_bond2, "num_grat_arp"); - } - - if (!value2) - value2 = _bond_get_option_default (s_bond2, key); - if (!nm_streq (value, value2)) + if (!nm_streq0 (value, _bond_get_option (s_bond2, key))) return FALSE; } diff --git a/libnm-core/tests/test-setting.c b/libnm-core/tests/test-setting.c index 71f484bab5..2dc76f1000 100644 --- a/libnm-core/tests/test-setting.c +++ b/libnm-core/tests/test-setting.c @@ -641,21 +641,23 @@ test_bond_compare (void) ((const char *[]){ "mode", "balance-rr", "miimon", "1", NULL }), ((const char *[]){ "mode", "balance-rr", "miimon", "2", NULL })); - /* ignore default values */ - test_bond_compare_options (TRUE, + test_bond_compare_options (FALSE, ((const char *[]){ "miimon", "1", NULL }), ((const char *[]){ "miimon", "1", "updelay", "0", NULL })); - /* special handling of num_grat_arp, num_unsol_na */ test_bond_compare_options (FALSE, ((const char *[]){ "num_grat_arp", "2", NULL }), ((const char *[]){ "num_grat_arp", "1", NULL })); - test_bond_compare_options (TRUE, + test_bond_compare_options (FALSE, ((const char *[]){ "num_grat_arp", "3", NULL }), ((const char *[]){ "num_unsol_na", "3", NULL })); - test_bond_compare_options (TRUE, + test_bond_compare_options (FALSE, ((const char *[]){ "num_grat_arp", "4", NULL }), ((const char *[]){ "num_unsol_na", "4", "num_grat_arp", "4", NULL })); + + test_bond_compare_options (FALSE, + ((const char *[]){ "mode", "balance-rr", "miimon", "100", NULL }), + ((const char *[]){ "mode", "balance-rr", NULL })); } static void