From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QLxm2-0008Q6-Dd for garchives@archives.gentoo.org; Mon, 16 May 2011 13:23:50 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 42AE61C18D; Mon, 16 May 2011 13:23:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0ED251C18D for ; Mon, 16 May 2011 13:23:42 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 89C8C1B4024 for ; Mon, 16 May 2011 13:23:42 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 0B6E47448A for ; Mon, 16 May 2011 13:23:42 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: Subject: [gentoo-commits] proj/openrc:master commit in: net/ X-VCS-Repository: proj/openrc X-VCS-Files: net/bonding.sh X-VCS-Directories: net/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: db1daa585737a03690d4d8e4040705b9c9c9c5ef Date: Mon, 16 May 2011 13:23:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 5f0fbdca4ebecf05b72eee53dd1208cf commit: db1daa585737a03690d4d8e4040705b9c9c9c5ef Author: Kfir Lavi gmail com> AuthorDate: Mon May 16 13:21:18 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Mon May 16 13:21:18 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3Ddb1daa58 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=3D366653 Signed-off-by: Anthony G. Basile gentoo.org> --- net/bonding.sh | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/bonding.sh b/net/bonding.sh index 6d15f0d..15f41e2 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=3D/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}" =3D "${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