aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJory A. Pratt <anarchy@gentoo.org>2010-10-31 16:40:54 -0500
committerJory A. Pratt <anarchy@gentoo.org>2010-10-31 16:40:54 -0500
commit68c021c424bde935fca8f81f16811995de6ae448 (patch)
treee0d0607653ec6a791c1cca14d8ae0b6231bc143f
parent09bed967bf610ee9e52a7eab772fa6f9c7b3e00b (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.
-rw-r--r--net/bonding.sh19
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}" || \