From 68c021c424bde935fca8f81f16811995de6ae448 Mon Sep 17 00:00:00 2001 From: "Jory A. Pratt" Date: Sun, 31 Oct 2010 16:40:54 -0500 Subject: [PATCH] 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 for patch. --- net/bonding.sh | 19 +++++++++++++++++-- 1 file 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}" || \