summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-10-03 14:18:38 +0200
committerThomas Haller <thaller@redhat.com>2014-10-03 14:53:06 +0200
commit3b1528417aa7072b62596344184ee0ce0519aaa4 (patch)
treed5aca50b069fdc0b6f2fc281637acf610396be07
parentb365a38bc33ba2bbe001f2920eb0b70c0b8a2b6c (diff)
downloadNetworkManager-3b1528417aa7072b62596344184ee0ce0519aaa4.tar.gz
bond: fix setting bond option 'lacp_rate'
Setting 'lacp_rate' is only possible in '802.3ad' (4) mode. Otherwise writing to sysctl fails and results in the following error log: <error> [1412337854.026285] [platform/nm-linux-platform.c:2093] sysctl_set(): sysctl: failed to set '/sys/class/net/nm-bond/bonding/lacp_rate' to '0': (13) Permission denied <warn> (nm-bond): failed to set bonding attribute 'lacp_rate' to '0' Related: https://bugzilla.redhat.com/show_bug.cgi?id=1061702 Fixes: 47555449fa1b66604ea6645eb6fd97fc131cbc9e Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--src/devices/nm-device-bond.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c
index e365ee6d66..68375d81f5 100644
--- a/src/devices/nm-device-bond.c
+++ b/src/devices/nm-device-bond.c
@@ -360,7 +360,10 @@ apply_bonding_config (NMDevice *device)
set_simple_option (device, "ad_select", s_bond, NM_SETTING_BOND_OPTION_AD_SELECT);
set_simple_option (device, "xmit_hash_policy", s_bond, NM_SETTING_BOND_OPTION_XMIT_HASH_POLICY);
set_simple_option (device, "resend_igmp", s_bond, NM_SETTING_BOND_OPTION_RESEND_IGMP);
- set_simple_option (device, "lacp_rate", s_bond, NM_SETTING_BOND_OPTION_LACP_RATE);
+
+ if ( g_strcmp0 (mode, "4") == 0
+ || g_strcmp0 (mode, "802.3ad") == 0)
+ set_simple_option (device, "lacp_rate", s_bond, NM_SETTING_BOND_OPTION_LACP_RATE);
return NM_ACT_STAGE_RETURN_SUCCESS;
}