aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2006-06-30 20:02:42 +0000
committerBill Nottingham <notting@redhat.com>2006-06-30 20:02:42 +0000
commit98ff30f0077b9fe78ba1ddda1dc7cc6faaa17188 (patch)
tree49bd05bca4723cf3f80cb2fe2bffb217ab5548c0
parent4d0100d922a1935a23ec5ba826fc2cea60d3d41f (diff)
downloadinitscripts-98ff30f0077b9fe78ba1ddda1dc7cc6faaa17188.tar
initscripts-98ff30f0077b9fe78ba1ddda1dc7cc6faaa17188.tar.gz
initscripts-98ff30f0077b9fe78ba1ddda1dc7cc6faaa17188.tar.bz2
initscripts-98ff30f0077b9fe78ba1ddda1dc7cc6faaa17188.tar.xz
initscripts-98ff30f0077b9fe78ba1ddda1dc7cc6faaa17188.zip
backport bridge fixes (#187100)
-rw-r--r--initscripts.spec5
-rwxr-xr-xrc.d/init.d/network42
-rwxr-xr-xsysconfig/network-scripts/ifdown-eth9
-rwxr-xr-xsysconfig/network-scripts/ifup-eth35
4 files changed, 38 insertions, 53 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 34ddb034..96ae331b 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -1,6 +1,6 @@
Summary: The inittab file and the /etc/init.d scripts.
Name: initscripts
-Version: 8.31.2
+Version: 8.31.3
License: GPL
Group: System Environment/Base
Release: 1
@@ -209,6 +209,9 @@ rm -rf $RPM_BUILD_ROOT
%ghost %attr(0664,root,utmp) /var/run/utmp
%changelog
+* Fri Jun 30 2006 Bill Nottingham <notting@redhat.com> 8.31.3-1
+- backport bridge fixes (#187100)
+
* Fri Mar 17 2006 Bill Nottingham <notting@redhat.com> 8.31.2-1
- add udev helper to rename network devices on device creation
diff --git a/rc.d/init.d/network b/rc.d/init.d/network
index 943b7798..2a287dd6 100755
--- a/rc.d/init.d/network
+++ b/rc.d/init.d/network
@@ -94,43 +94,36 @@ case "$1" in
# bring up all other interfaces configured to come up at boot time
for i in $interfaces; do
+ unset DEVICE TYPE SLAVE
eval $(LANG=C fgrep "DEVICE=" ifcfg-$i)
eval $(LANG=C fgrep "TYPE=" ifcfg-$i)
eval $(LANG=C fgrep "SLAVE=" ifcfg-$i)
- eval $(LANG=C fgrep "BRIDGE=" ifcfg-$i)
-
+
if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then
cipeinterfaces="$cipeinterfaces $i"
- unset DEVICE TYPE SLAVE BRIDGE
continue
fi
if [ "$TYPE" = "xDSL" ]; then
xdslinterfaces="$xdslinterfaces $i"
- unset DEVICE TYPE SLAVE BRIDGE
continue
fi
-
- if [ -n "$BRIDGE" ]; then
- is_available $i
+
+ if [ "$TYPE" = "Bridge" ]; then
bridgeinterfaces="$bridgeinterfaces $i"
- unset DEVICE TYPE SLAVE BRIDGE
continue
fi
if [ "${DEVICE%%.*}" != "$DEVICE" ] ; then
vlaninterfaces="$vlaninterfaces $i"
- unset DEVICE TYPE SLAVE BRIDGE
continue
fi
if [ "$SLAVE" = "yes" ]; then
- unset DEVICE TYPE SLAVE BRIDGE
continue
fi
- unset DEVICE TYPE SLAVE BRIDGE
-
+
if LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i > /dev/null ; then
# this loads the module, to preserve ordering
is_available $i
@@ -202,55 +195,42 @@ case "$1" in
# get list of bonding, cipe, and xdsl interfaces
for i in $interfaces; do
+ unset DEVICE TYPE
eval $(LANG=C fgrep "DEVICE=" ifcfg-$i)
eval $(LANG=C fgrep "TYPE=" ifcfg-$i)
- eval $(LANG=C fgrep "BRIDGE=" ifcfg-$i)
-
+
if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then
cipeinterfaces="$cipeinterfaces $i"
- unset DEVICE TYPE BRIDGE
continue
fi
- if [ -n "$BRIDGE" ]; then
+ if [ "$TYPE" = "Bridge" ]; then
bridgeinterfaces="$bridgeinterfaces $i"
- unset DEVICE TYPE BRIDGE
continue
fi
if [ "$TYPE" = "xDSL" ]; then
xdslinterfaces="$xdslinterfaces $i"
- unset DEVICE TYPE BRIDGE
continue
fi
if [ "${DEVICE%%.*}" != "$DEVICE" ] ; then
vlaninterfaces="$vlaninterfaces $i"
- unset DEVICE TYPE SLAVE BRIDGE
continue
fi
remaining="$remaining $i"
- unset DEVICE TYPE BRIDGE
done
- for i in $cipeinterfaces $xdslinterfaces $bridgeinterfaces $vlaninterfaces; do
- eval $(fgrep "DEVICE=" ifcfg-$i)
+ for i in $cipeinterfaces $xdslinterfaces $bridgeinterfaces $vlaninterfaces $remaining; do
+ (. ifcfg-$i
if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
if ! check_device_down $DEVICE; then
action $"Shutting down interface $i: " ./ifdown $i boot
fi
+ )
done
-
- # shut down all interfaces (other than loopback)
- for i in $remaining ; do
- eval $(fgrep "DEVICE=" ifcfg-$i)
- if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
- if ! check_device_down $DEVICE; then
- action $"Shutting down interface $i: " ./ifdown $i boot
- fi
- done
case "$IPX" in
yes|true)
if [ "$IPXINTERNALNETNUM" != "0" ]; then
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index 55c02fbd..6651c93f 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -26,8 +26,11 @@ if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then
# Upon removing a device from a bridge,
# it's necessary to make radvd reload its config
[ -r /var/run/radvd/radvd.pid ] && kill -HUP `cat /var/run/radvd/radvd.pid`
+ if LC_ALL=C /usr/sbin/brctl show | LC_ALL=C grep -q "^${BRIDGE} .*can't get port info"; then
+ /usr/sbin/brctl delbr ${BRIDGE}
+ fi
exit 0
-fi
+fi
. /etc/sysconfig/network
@@ -108,10 +111,6 @@ if [ "$retcode" = 0 ] ; then
# the interface went down.
fi
-if [ "$TYPE" = "Bridge" -a -x /usr/sbin/brctl ]; then
- /usr/sbin/brctl delbr ${DEVICE}
-fi
-
if [ -n "$VLAN" -a -x /sbin/vconfig ]; then
# 802.1q VLAN
if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q '(eth|bond)[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?' \
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index d66ba5af..aaf3d4c2 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -50,27 +50,14 @@ if [ -n "${HWADDR}" ]; then
fi
fi
-# now check the real state
-is_available ${REALDEVICE} || {
- if [ -n "$alias" ]; then
- echo $"$alias device ${DEVICE} does not seem to be present, delaying initialization."
- else
- echo $"Device ${DEVICE} does not seem to be present, delaying initialization."
- fi
- exit 1
-}
-
-# is the device wireless? If so, configure wireless device specifics
-is_wireless_device ${DEVICE} && . ./ifup-wireless
-
if [ "${TYPE}" = "Bridge" ]; then
if [ ! -x /usr/sbin/brctl ]; then
echo $"Bridge support not available: brctl not found"
exit 1
fi
- /sbin/ip link set dev ${DEVICE} down 2>/dev/null
- /usr/sbin/brctl delbr ${DEVICE} 2>/dev/null
- /usr/sbin/brctl addbr ${DEVICE} 2>/dev/null
+ if ! LC_ALL=C /usr/sbin/brctl show | LC_ALL=C grep -q "^${DEVICE} "; then
+ /usr/sbin/brctl addbr ${DEVICE} 2>/dev/null
+ fi
# brctl doesn't report success/failure (BZ #104408)
# Test for ourselves whether it worked.
if ! /usr/sbin/brctl show | LANG=C grep -q "^${DEVICE} " ; then
@@ -82,7 +69,23 @@ if [ "${TYPE}" = "Bridge" ]; then
[ -n "${STP}" ] && /usr/sbin/brctl stp ${DEVICE} ${STP}
fi
+# now check the real state
+is_available ${REALDEVICE} || {
+ if [ -n "$alias" ]; then
+ echo $"$alias device ${DEVICE} does not seem to be present, delaying initialization."
+ else
+ echo $"Device ${DEVICE} does not seem to be present, delaying initialization."
+ fi
+ exit 1
+}
+
+# is the device wireless? If so, configure wireless device specifics
+is_wireless_device ${DEVICE} && . ./ifup-wireless
+
if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then
+ if ! LC_ALL=C /usr/sbin/brctl show | LC_ALL=C grep -q "^${BRIDGE} "; then
+ /usr/sbin/brctl addbr ${BRIDGE} 2>/dev/null
+ fi
/sbin/ip addr flush dev ${DEVICE} 2>/dev/null
/sbin/ip link set dev ${DEVICE} up
/usr/sbin/brctl addif ${BRIDGE} ${DEVICE}