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 A33B9139694 for ; Fri, 9 Jun 2017 23:52:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F00DBE0C2F; Fri, 9 Jun 2017 23:52:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 C9D71E0C2F for ; Fri, 9 Jun 2017 23:52:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 8E496341B07 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 076FA7470 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: <1497052098.85f486367ab158b605d8817571028c90bccdc130.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: 85f486367ab158b605d8817571028c90bccdc130 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: 0ac89f97-5fe2-490e-9da6-9468b9f417a6 X-Archives-Hash: 1397adb2d38ebdee10d2ff45edd3890c commit: 85f486367ab158b605d8817571028c90bccdc130 Author: Marc Schiffbauer gentoo org> AuthorDate: Mon Feb 6 18:23:41 2017 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Fri Jun 9 23:48:18 2017 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=85f48636 bonding: add arp_ip_targets properly netifrc handles bonding interfaces in /lib/netifrc/net/bonding.sh which will apply all settings (*_bondX) like 'echo "${s}" >"${x}"' which will not work for bonding arip ip targets: these have to be added by using "echo + > arp_ip_target" Please consider merging the attached patch which will fix that feature and make netifrc work correctly with bonding interfaces when using arp_ip_target instead of miimon. Signed-off-by: Robin H. Johnson gentoo.org> net/bonding.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/net/bonding.sh b/net/bonding.sh index d0ed319..a25bf1f 100644 --- a/net/bonding.sh +++ b/net/bonding.sh @@ -1,4 +1,5 @@ # Copyright (c) 2007-2008 Roy Marples +# 2017 Marc Schiffbauer # Released under the 2-clause BSD license. bonding_depend() @@ -21,7 +22,7 @@ _is_bond() bonding_pre_start() { - local x= s= n= slaves= primary= + local x= s= n= i= slaves= primary= slaves="$(_get_array "slaves_${IFVAR}")" unset slaves_${IFVAR} @@ -76,13 +77,26 @@ bonding_pre_start() eerror "Failed to configure $n (${n}_${IFVAR})" fi done + # Configure arp ip targets, they need to be added one after another + n=arp_ip_target + x=/sys/class/net/"${IFACE}"/bonding/$n + [ -d /sys/class/net ] && if [ -f "$x" ]; then + eval s=\$${n}_${IFVAR} + if [ -n "${s}" ]; then + for i in $s; do + einfo "Adding ${n}: ${i}" + echo "+${i/+/}" >"${x}" || \ + eerror "Failed to add $i (${n}_${IFVAR})" + done + fi + fi # Nice and dynamic for remaining options:) [ -d /sys/class/net ] && for x in /sys/class/net/"${IFACE}"/bonding/*; do [ -f "${x}" ] || continue n=${x##*/} eval s=\$${n}_${IFVAR} # skip mode and miimon - [ "${n}" = "mode" -o "${n}" = "miimon" ] && continue + [ "${n}" = "mode" -o "${n}" = "miimon" -o "${n}" = "arp_ip_target" ] && continue if [ -n "${s}" ]; then einfo "Setting ${n}: ${s}" echo "${s}" >"${x}" || \