summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2013-09-19 17:10:51 +0200
committerJiří Klimeš <jklimes@redhat.com>2013-10-01 17:26:03 +0200
commit6d2e033a0efe588b7592c2a7c3cc9769c3f7cace (patch)
treedf2d04c07bd836a6b381f70bef08d35e7a761054
parent0f88cb13f17d814823dcde922c0ec7a3cc2c8945 (diff)
downloadNetworkManager-6d2e033a0efe588b7592c2a7c3cc9769c3f7cace.tar.gz
libnm-util: only remove ARP when MIIMON is being set to non-zero and vice versa
miimon or arp_interval == 0 means 'disable'. So we should not remove options of one mode when the other mode is actually being disabled (set to zero).
-rw-r--r--libnm-util/nm-setting-bond.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libnm-util/nm-setting-bond.c b/libnm-util/nm-setting-bond.c
index 860d25e51b..f3dc0f8640 100644
--- a/libnm-util/nm-setting-bond.c
+++ b/libnm-util/nm-setting-bond.c
@@ -259,10 +259,12 @@ gboolean nm_setting_bond_add_option (NMSettingBond *setting,
g_hash_table_insert (priv->options, g_strdup (name), g_strdup (value));
- if (!strcmp (name, NM_SETTING_BOND_OPTION_MIIMON)) {
+ if ( !strcmp (name, NM_SETTING_BOND_OPTION_MIIMON)
+ && strcmp (value, "0") != 0) {
g_hash_table_remove (priv->options, NM_SETTING_BOND_OPTION_ARP_INTERVAL);
g_hash_table_remove (priv->options, NM_SETTING_BOND_OPTION_ARP_IP_TARGET);
- } else if (!strcmp (name, NM_SETTING_BOND_OPTION_ARP_INTERVAL)) {
+ } else if ( !strcmp (name, NM_SETTING_BOND_OPTION_ARP_INTERVAL)
+ && strcmp (value, "0") != 0) {
g_hash_table_remove (priv->options, NM_SETTING_BOND_OPTION_MIIMON);
g_hash_table_remove (priv->options, NM_SETTING_BOND_OPTION_DOWNDELAY);
g_hash_table_remove (priv->options, NM_SETTING_BOND_OPTION_UPDELAY);