From 3b1528417aa7072b62596344184ee0ce0519aaa4 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 3 Oct 2014 14:18:38 +0200 Subject: [PATCH] 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: [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 (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 --- src/devices/nm-device-bond.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; }