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: 47555449fa
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-10-03 14:18:38 +02:00
parent b365a38bc3
commit 3b1528417a

View file

@ -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;
}