From 6e3b3bfc5371d72c1bc436f7bc7c12cb2d1a81b1 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Fri, 13 Aug 2010 17:32:31 -0400 Subject: Fix bug #332181. Thanks Lutz Heermann. --- net/bonding.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'net') 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 -- cgit v1.2.3