summaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2009-08-03 12:40:58 -0700
committerAaron Griffin <aaronmgriffin@gmail.com>2009-08-03 12:40:58 -0700
commit0dd360f4d0c880a0e9b1a18354196740626ad123 (patch)
tree3860971f377e05f722b7d97e13c5c97d7067ada5 /network
parentb05933da4de82fe515c1eee5e5a7690072b99c79 (diff)
Allow creation of bridges with bonded interfaces
Ref: FS#10616 Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'network')
-rwxr-xr-xnetwork25
1 files changed, 24 insertions, 1 deletions
diff --git a/network b/network
index 6e68877..0381e5d 100755
--- a/network
+++ b/network
@@ -128,7 +128,19 @@ bond_up()
for ifline in ${BOND_INTERFACES[@]}; do
if [ "$ifline" = "${ifline#!}" ]; then
eval bondcfg="\$bond_${ifline}"
- /sbin/ifenslave $ifline $bondcfg || error=1
+ if [ -n "${bondcfg}" ]; then
+ /sbin/ifenslave $ifline $bondcfg || error=1
+ fi
+ fi
+ done
+}
+
+bond_down()
+{
+ for ifline in ${BOND_INTERFACES[@]}; do
+ if [ "$ifline" = "${ifline#!}" ]; then
+ eval bondcfg="\$bond_${ifline}"
+ /sbin/ifenslave -d $ifline $bondcfg || error=1
fi
done
}
@@ -146,6 +158,15 @@ bridge_up()
eval brifs="\$bridge_${br}"
for brif in $brifs; do
if [ "$brif" = "${brif#!}" ]; then
+ for ifline in ${BOND_INTERFACES[@]}; do
+ if [ "$brif" = "$ifline" ] && [ "$ifline" = "${ifline#!}" ]; then
+ ifup $ifline
+ eval bondcfg="\$bond_${ifline}"
+ /sbin/ifenslave $ifline $bondcfg || error=1
+ unset bond_${ifline}
+ fi
+ done
+
/usr/sbin/brctl addif $br $brif || error=1
fi
done
@@ -209,6 +230,8 @@ case "$1" in
rtdown $rtline || error=1
fi
done
+ # bring down bond interfaces
+ bond_down
for ifline in ${INTERFACES[@]}; do
if [ "$ifline" = "${ifline#!}" ]; then
ifdown $ifline || error=1