diff options
author | Anthony G. Basile <basile@opensource.dyc.edu> | 2010-08-13 17:32:31 -0400 |
---|---|---|
committer | Anthony G. Basile <basile@opensource.dyc.edu> | 2010-08-13 17:32:31 -0400 |
commit | 6e3b3bfc5371d72c1bc436f7bc7c12cb2d1a81b1 (patch) | |
tree | f7f6ccb862c9f8f2ebce3f59bfef1cd22de5d51b /net/bonding.sh | |
parent | 14c95ae9a60f2518aeb3bb47e482af3256dee98e (diff) |
Fix bug #332181. Thanks Lutz Heermann.
Diffstat (limited to 'net/bonding.sh')
-rw-r--r-- | net/bonding.sh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/net/bonding.sh b/net/bonding.sh index 559c9a1e..205af2bc 100644 --- a/net/bonding.sh +++ b/net/bonding.sh @@ -15,7 +15,14 @@ _is_bond() bonding_pre_start() { - local x= s= n= slaves="$(_get_array "slaves_${IFVAR}")" + local x= s= n= slaves= primary= + + slaves="$(_get_array "slaves_${IFVAR}")" + unset slaves_${IFVAR} + + eval primary="\$primary_${IFVAR}" + unset primary_${IFVAR} + [ -z "${slaves}" ] && return 0 @@ -46,6 +53,7 @@ bonding_pre_start() 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 @@ -74,6 +82,11 @@ bonding_pre_start() # finally add in slaves eoutdent if [ -d /sys/class/net ]; then + if [ -n "${primary}" ]; then + echo "+${primary}" >/sys/class/net/"${IFACE}"/bonding/slaves + echo "${primary}" >/sys/class/net/"${IFACE}"/bonding/primary + slaves="${slaves/${primary}/}" + fi for s in ${slaves}; do echo "+${s}" >/sys/class/net/"${IFACE}"/bonding/slaves done |