aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2004-06-08 19:50:13 +0000
committerBill Nottingham <notting@redhat.com>2004-06-08 19:50:13 +0000
commit25ce6eb243bf550d0a379eefe3795df6ccc541e9 (patch)
treec96b8ff3b4d03b5ae2f2ba64d12bf3ea4926b245
parent084a58eed7e5bef4951cd4f7ce5fa65a6ce13935 (diff)
downloadinitscripts-25ce6eb243bf550d0a379eefe3795df6ccc541e9.tar
initscripts-25ce6eb243bf550d0a379eefe3795df6ccc541e9.tar.gz
initscripts-25ce6eb243bf550d0a379eefe3795df6ccc541e9.tar.bz2
initscripts-25ce6eb243bf550d0a379eefe3795df6ccc541e9.tar.xz
initscripts-25ce6eb243bf550d0a379eefe3795df6ccc541e9.zip
backport bonding fixes
-rwxr-xr-xsysconfig/network-scripts/ifup30
1 files changed, 27 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 7fb3881c..087d0e0a 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -171,16 +171,23 @@ if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" -a \
/sbin/ip link set dev ${DEVICE} down
echo $"Enslaving ${DEVICE} to ${MASTER}"
- ifenslave ${RFLAG} "${MASTER}" "${DEVICE}"
+ ifenslave ${RFLAG} "${MASTER}" "${DEVICE}" >/dev/null 2>&1
exit 0
fi
-# master device?
+# Bonding initialization. For DHCP, we need to enslave the devices early,
+# so it can actually get an IP.
if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then
/sbin/ip link set dev ${DEVICE} up
for device in `fgrep -l "MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
- /sbin/ifup ${device##*/}
+ if [ "$BOOTPROTO" = "dhcp" ]; then
+ DEV=$DEVICE
+ eval $(LANG=C fgrep "DEVICE=" $device)
+ ifenslave -d $DEV $DEVICE >/dev/null 2>&1
+ DEVICE=$DEV
+ /sbin/ifup ${device##*/}
+ fi
done
fi
@@ -348,6 +355,23 @@ else
fi
+# Bonding initialization part II - for static, enslave the devices. For
+# DHCP, remove any routes for the slaves.
+if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then
+ #/sbin/ip link set dev ${DEVICE} up
+ for device in `fgrep -l "MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
+ if [ "$BOOTPROTO" != "dhcp" ]; then
+ /sbin/ifup ${device##*/}
+ else
+ DEV=$DEVICE
+ eval $(LANG=C fgrep "DEVICE=" $device)
+ ip link set ${DEVICE} up
+ ip route flush dev ${DEVICE}
+ DEVICE=$DEV
+ fi
+ done
+fi
+
# Add Zeroconf route.
if [ -z "${NOZEROCONF}" -a "${ISALIAS}" = "no" ]; then
ip route replace 169.254.0.0/16 dev ${REALDEVICE}