aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKfir Lavi <lavi.kfir@gmail.com>2011-05-16 09:21:18 -0400
committerAnthony G. Basile <blueness@gentoo.org>2011-05-16 09:21:18 -0400
commitdb1daa585737a03690d4d8e4040705b9c9c9c5ef (patch)
tree313c6827b8b8ef657ca135f5021e7fc5bb8a3833
parent2493a1f32e7ae95f0f3d3c63cb4af7abdc34959b (diff)
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 <blueness@gentoo.org>
-rw-r--r--net/bonding.sh8
1 files changed, 5 insertions, 3 deletions
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