diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-05-22 12:05:12 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-05-22 12:05:12 +0000 |
commit | 435ab494ec2d03552e483113908a2b580019f061 (patch) | |
tree | 221934f8b2d19f9b079fc1158fc3367918e046e8 /main/bonding | |
parent | 81f0d6daf71225978c90f7ad80dd3076ef1519f7 (diff) | |
download | aports-435ab494ec2d03552e483113908a2b580019f061.tar.bz2 aports-435ab494ec2d03552e483113908a2b580019f061.tar.xz |
main/bonding: set up bond-master properly when initiated by slave
ref #1176
Diffstat (limited to 'main/bonding')
-rw-r--r-- | main/bonding/APKBUILD | 4 | ||||
-rwxr-xr-x | main/bonding/bonding.pre-up | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/main/bonding/APKBUILD b/main/bonding/APKBUILD index f77880b768..4cdb755f25 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 69f6fbe261..17f27070cc 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 |