From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A12101389E2 for ; Thu, 11 Dec 2014 18:13:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0B7E9E0EC7; Thu, 11 Dec 2014 18:13:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9A6E9E0EC4 for ; Thu, 11 Dec 2014 18:13:54 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CFB3734059D for ; Thu, 11 Dec 2014 18:13:53 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4C99DC28C for ; Thu, 11 Dec 2014 18:13:52 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1418250041.a93c80793276a026eef5be351cf33377945d8518.robbat2@OpenRC> Subject: [gentoo-commits] proj/netifrc:master commit in: net/ X-VCS-Repository: proj/netifrc X-VCS-Files: net/bonding.sh X-VCS-Directories: net/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: a93c80793276a026eef5be351cf33377945d8518 X-VCS-Branch: master Date: Thu, 11 Dec 2014 18:13:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: ef4288af-126b-4966-bb89-f552faa65b74 X-Archives-Hash: 349b74840c87f72bd3a3d368a5b6071b commit: a93c80793276a026eef5be351cf33377945d8518 Author: Patrick McLean gaikai com> AuthorDate: Wed Dec 10 21:58:26 2014 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Wed Dec 10 22:20:41 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/netifrc.git;a=commit;h=a93c8079 bonding: use iproute2 rather than ifconfig if it is installed Currently the bonding contains 2 calls to ifconfig for a couple of operations, this makes it use iproute2 instead if it is installed. --- net/bonding.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/net/bonding.sh b/net/bonding.sh index fb00825..ba75239 100644 --- a/net/bonding.sh +++ b/net/bonding.sh @@ -4,7 +4,7 @@ bonding_depend() { before interface macchanger - program /sbin/ifconfig /bin/ifconfig + program ip /sbin/ifconfig /bin/ifconfig # If you do not have sysfs, you MUST have this binary instead for ioctl # Also you will loose some functionality that cannot be done via sysfs: if [ ! -d /sys/class/net ]; then @@ -124,7 +124,12 @@ bonding_pre_start() unset oiface eoutdent # subsume (presumably kernel auto-)configured IP - ifconfig ${IFACE} ${addr} up + if [ -x "$(command -v ip)" ]; then + ip link set ${IFACE} up + ip address add ${addr} dev ${IFACE} + else + ifconfig ${IFACE} ${addr} up + fi else # warn if root on nfs and no subsume interface supplied local root_fs_type=$(mountinfo -s /) @@ -179,7 +184,11 @@ bonding_stop() # Wipe subsumed interface if [ -n "${subsume}" ]; then - ifconfig ${subsume} 0.0.0.0 + if [ -x "$(command -v ip)" ]; then + ip address flush dev ${subsume} + else + ifconfig ${subsume} 0.0.0.0 + fi fi local slaves= s=