net/bonding: Fix which interface IPs get added to.

The previous bonding change of ensuring interfaces were down to add
slave interfaces, but it clobbered the IFACE variable, because it was
being passed to a bash function rather than a command.

X-Gentoo-Bug: 400613
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=400613
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
This commit is contained in:
Robin H. Johnson 2012-01-25 10:30:33 -08:00
parent 8b4fc05ff2
commit fb00b10669

View File

@ -102,15 +102,21 @@ bonding_pre_start()
eoutdent
if [ -d /sys/class/net ]; then
sys_bonding_path=/sys/class/net/"${IFACE}"/bonding
local oiface
oiface=$IFACE
if [ -n "${primary}" ]; then
IFACE=$primary _down
IFACE=$primary
_down
IFACE=$oiface
echo "+${primary}" >$sys_bonding_path/slaves
echo "${primary}" >$sys_bonding_path/primary
fi
for s in ${slaves}; do
[ "${s}" = "${primary}" ] && continue
if ! grep -q ${s} $sys_bonding_path/slaves; then
IFACE=$s _down
IFACE=$s
_down
IFACE=$oiface
echo "+${s}" >$sys_bonding_path/slaves
fi
done