aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2009-03-11 13:32:18 -0400
committerBill Nottingham <notting@redhat.com>2009-03-11 13:32:18 -0400
commit8487682c3443413b0ca3325237410d8c2ba4f11e (patch)
treea9c4a0bf85ad5b599655c63636aa4ec6dfcb6f06 /sysconfig/network-scripts
parentbd403c37fc1593cfbdaaa4abc7d0dd7da19c4b18 (diff)
downloadinitscripts-8487682c3443413b0ca3325237410d8c2ba4f11e.tar
initscripts-8487682c3443413b0ca3325237410d8c2ba4f11e.tar.gz
initscripts-8487682c3443413b0ca3325237410d8c2ba4f11e.tar.bz2
initscripts-8487682c3443413b0ca3325237410d8c2ba4f11e.tar.xz
initscripts-8487682c3443413b0ca3325237410d8c2ba4f11e.zip
Cleanup bridges better on ifdown (#463325, <sean@bruenor@org>)
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-xsysconfig/network-scripts/ifdown-eth22
1 files changed, 11 insertions, 11 deletions
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index 3ebaff33..f5fb16f6 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -26,17 +26,6 @@ CONFIG=${1}
source_config
-if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then
- /sbin/ip link set dev ${DEVICE} down
- /usr/sbin/brctl delif ${BRIDGE} ${DEVICE}
- # 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
-fi
-
. /etc/sysconfig/network
# Check to make sure the device is actually up
@@ -116,6 +105,17 @@ if [ -d "/sys/class/net/${REALDEVICE}" ]; then
fi
[ "$retcode" = "0" ] && retcode=$?
+if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then
+ /sbin/ip link set dev ${DEVICE} down
+ /usr/sbin/brctl delif ${BRIDGE} ${DEVICE}
+ # 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 [ -d /sys/class/net/${BRIDGE}/brif ] && [ `ls -1 /sys/class/net/${BRIDGE}/brif | wc -l` -eq 0 ]; then
+ /usr/sbin/brctl delbr ${BRIDGE}
+ fi
+fi
+
# wait up to 5 seconds for device to actually come down...
waited=0
while ! check_device_down ${DEVICE} && [ "$waited" -lt 50 ] ; do