From db1daa585737a03690d4d8e4040705b9c9c9c5ef Mon Sep 17 00:00:00 2001 From: Kfir Lavi Date: Mon, 16 May 2011 09:21:18 -0400 Subject: Do not add slaves to bond interface if they are already added X-Gentoo-Bug: 366653 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=366653 Signed-off-by: Anthony G. Basile --- net/bonding.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'net') diff --git a/net/bonding.sh b/net/bonding.sh index 6d15f0da..15f41e20 100644 --- a/net/bonding.sh +++ b/net/bonding.sh @@ -97,13 +97,15 @@ bonding_pre_start() # finally add in slaves eoutdent if [ -d /sys/class/net ]; then + sys_bonding_path=/sys/class/net/"${IFACE}"/bonding if [ -n "${primary}" ]; then - echo "+${primary}" >/sys/class/net/"${IFACE}"/bonding/slaves - echo "${primary}" >/sys/class/net/"${IFACE}"/bonding/primary + echo "+${primary}" >$sys_bonding_path/slaves + echo "${primary}" >$sys_bonding_path/primary fi for s in ${slaves}; do [ "${s}" = "${primary}" ] && continue - echo "+${s}" >/sys/class/net/"${IFACE}"/bonding/slaves + grep -q ${s} $sys_bonding_path/slaves \ + || echo "+${s}" >$sys_bonding_path/slaves done else /sbin/ifenslave "${IFACE}" ${slaves} >/dev/null -- cgit v1.2.3