diff options
author | Jory A. Pratt <anarchy@gentoo.org> | 2010-10-31 16:40:54 -0500 |
---|---|---|
committer | Jory A. Pratt <anarchy@gentoo.org> | 2010-10-31 16:40:54 -0500 |
commit | 68c021c424bde935fca8f81f16811995de6ae448 (patch) | |
tree | e0d0607653ec6a791c1cca14d8ae0b6231bc143f /net | |
parent | 09bed967bf610ee9e52a7eab772fa6f9c7b3e00b (diff) |
ensure bonding interface is down before we attempt to configure, also
mode has to be configure before any other arguements are passed. Thanks
Ed Wildgoose <gentoo@wildgooses.com> for patch.
Diffstat (limited to 'net')
-rw-r--r-- | net/bonding.sh | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/net/bonding.sh b/net/bonding.sh index 1a4886eb..415306c5 100644 --- a/net/bonding.sh +++ b/net/bonding.sh @@ -46,12 +46,27 @@ bonding_pre_start() return 1 fi - # Configure the bond. - # Nice and dynamic :) + # Interface must be down in order to configure + _down + + # Configure the bond mode, then we can reloop to ensure we configure + # All other options + for x in /sys/class/net/"${IFACE}"/bonding/mode; do + [ -f "${x}" ] || continue + n=${x##*/} + eval s=\$${n}_${IFVAR} + if [ -n "${s}" ]; then + einfo "Setting ${n}: ${s}" + echo "${s}" >"${x}" || \ + eerror "Failed to configure $n (${n}_${IFVAR})" + fi + done + # Nice and dynamic for remaining options:) for x in /sys/class/net/"${IFACE}"/bonding/*; do [ -f "${x}" ] || continue n=${x##*/} eval s=\$${n}_${IFVAR} + [ "${n}" != "mode" ] || continue if [ -n "${s}" ]; then einfo "Setting ${n}: ${s}" echo "${s}" >"${x}" || \ |