From cb39e86afa1f3fb045d43f16066e82b4a15cfc46 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 22 May 2012 12:05:12 +0000 Subject: main/bonding: set up bond-master properly when initiated by slave fixes #1176 (cherry picked from commit 435ab494ec2d03552e483113908a2b580019f061) --- main/bonding/APKBUILD | 4 ++-- main/bonding/bonding.pre-up | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/main/bonding/APKBUILD b/main/bonding/APKBUILD index f77880b76..4cdb755f2 100644 --- a/main/bonding/APKBUILD +++ b/main/bonding/APKBUILD @@ -5,7 +5,7 @@ pkgname=bonding pkgver=2.6 -pkgrel=1 +pkgrel=2 pkgdesc="Scripts for network interface bonding" url="http://wiki.alpinelinux.org/wiki/Bonding" arch="noarch" @@ -38,6 +38,6 @@ package() { done } -md5sums="8feef9949a42f0a84418f785827c1fd2 bonding.pre-up +md5sums="e5b1ba826edd950bcf7bedf8cd550e9e bonding.pre-up 68e64f483be3f8730a4c522f1e63e92d bonding.up c5f6d07415118aa21d8e4730f9f18cab bonding.post-down" diff --git a/main/bonding/bonding.pre-up b/main/bonding/bonding.pre-up index 69f6fbe26..17f27070c 100755 --- a/main/bonding/bonding.pre-up +++ b/main/bonding/bonding.pre-up @@ -46,7 +46,7 @@ sysfs_add() done } -ifup_slave() +ifup_once() { local v= [ "$VERBOSITY" = 1 ] && v=-v @@ -78,7 +78,7 @@ enslave_slaves() else # Bring up slave if it is defined in interfaces # This is usefull to bring up slaves that need extra setup. - ifup_slave $slave + ifup_once $slave fi fi done @@ -125,8 +125,11 @@ IF_BOND_SLAVES=${IF_BOND_SLAVES:-$IF_SLAVES} if [ "$IF_BOND_MASTER" ] ; then BOND_MASTER="$IF_BOND_MASTER" BOND_SLAVES="$IFACE" + if ! [ -e /sys/class/net/$IFACE/master ]; then + ifup_once $BOND_MASTER + fi else - if [ "$IF_BOND_SLAVES" ] ; then + if [ "$IF_BOND_SLAVES$IF_BOND_MODE" ]; then BOND_MASTER="$IFACE" BOND_SLAVES="$IF_BOND_SLAVES" fi -- cgit v1.2.3