From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0541E139695 for ; Fri, 9 Jun 2017 23:52:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2302FE0C47; Fri, 9 Jun 2017 23:52:24 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 013CDE0C47 for ; Fri, 9 Jun 2017 23:52:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A7024341B13 for ; Fri, 9 Jun 2017 23:52:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1C3D57474 for ; Fri, 9 Jun 2017 23:52:21 +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: <1497052313.18bceba0c3cd4a40937d158f8b59461d0eebee7f.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: 18bceba0c3cd4a40937d158f8b59461d0eebee7f X-VCS-Branch: master Date: Fri, 9 Jun 2017 23:52:21 +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: bf0a452d-5c61-462f-a048-dec394b26824 X-Archives-Hash: d2df2ff4e888b7bad87d1676b37e5192 commit: 18bceba0c3cd4a40937d158f8b59461d0eebee7f Author: Robin H. Johnson gentoo org> AuthorDate: Fri Jun 9 23:51:53 2017 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Fri Jun 9 23:51:53 2017 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=18bceba0 bonding: make patching sysfs args easier in future. Signed-off-by: Robin H. Johnson gentoo.org> net/bonding.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/net/bonding.sh b/net/bonding.sh index a25bf1f..6e5d810 100644 --- a/net/bonding.sh +++ b/net/bonding.sh @@ -78,6 +78,7 @@ bonding_pre_start() fi done # Configure arp ip targets, they need to be added one after another + # With a leading '+' as a prefix. n=arp_ip_target x=/sys/class/net/"${IFACE}"/bonding/$n [ -d /sys/class/net ] && if [ -f "$x" ]; then @@ -94,9 +95,14 @@ bonding_pre_start() [ -d /sys/class/net ] && for x in /sys/class/net/"${IFACE}"/bonding/*; do [ -f "${x}" ] || continue n=${x##*/} + # These entries are already handled above. + case "$n" in + mode) continue ;; + miimon) continue ;; + arp_ip_target) continue ;; + esac + # Check if anything to do. eval s=\$${n}_${IFVAR} - # skip mode and miimon - [ "${n}" = "mode" -o "${n}" = "miimon" -o "${n}" = "arp_ip_target" ] && continue if [ -n "${s}" ]; then einfo "Setting ${n}: ${s}" echo "${s}" >"${x}" || \ @@ -156,7 +162,7 @@ bonding_pre_start() fi # up the interface _up - fi + fi # finally add in slaves # things needed in the process, and if they are done by ifenslave, openrc, and/or the kernel.