aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Kenigsberg <danken@redhat.com>2012-06-03 17:17:04 +0300
committerBill Nottingham <notting@redhat.com>2012-06-13 12:02:39 -0400
commit5383a660e73c066d3ceac172283328a58f6b33e5 (patch)
treecf82dde13be86a3b31fe8379681abe48ababb0e8
parent1a86bf339a45d2601a0da271a648a947f450e663 (diff)
downloadinitscripts-5383a660e73c066d3ceac172283328a58f6b33e5.tar
initscripts-5383a660e73c066d3ceac172283328a58f6b33e5.tar.gz
initscripts-5383a660e73c066d3ceac172283328a58f6b33e5.tar.bz2
initscripts-5383a660e73c066d3ceac172283328a58f6b33e5.tar.xz
initscripts-5383a660e73c066d3ceac172283328a58f6b33e5.zip
Allow bridge names starting with a dash
Misguided people may name their bridge '-foo', with a leading dash. Let us indulge them. It is better than showing the usage string of brctl. Signed-off-by: Dan Kenigsberg <danken@redhat.com>
-rwxr-xr-xsysconfig/network-scripts/ifdown-eth4
-rwxr-xr-xsysconfig/network-scripts/ifup-eth10
2 files changed, 7 insertions, 7 deletions
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index d7eb6370..036701c2 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -125,12 +125,12 @@ fi
if [ -n "${BRIDGE}" ] && [ -x /usr/sbin/brctl ]; then
/sbin/ip link set dev ${DEVICE} down
- /usr/sbin/brctl delif ${BRIDGE} ${DEVICE}
+ /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}
+ /usr/sbin/brctl delbr -- ${BRIDGE}
fi
fi
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index afea2372..8c8b588a 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -52,10 +52,10 @@ if [ "${TYPE}" = "Bridge" ]; then
exit 1
fi
if [ ! -d /sys/class/net/${DEVICE}/bridge ]; then
- /usr/sbin/brctl addbr ${DEVICE} || exit 1
+ /usr/sbin/brctl addbr -- ${DEVICE} || exit 1
fi
- [ -n "${DELAY}" ] && /usr/sbin/brctl setfd ${DEVICE} ${DELAY}
- [ -n "${STP}" ] && /usr/sbin/brctl stp ${DEVICE} ${STP}
+ [ -n "${DELAY}" ] && /usr/sbin/brctl setfd -- ${DEVICE} ${DELAY}
+ [ -n "${STP}" ] && /usr/sbin/brctl stp -- ${DEVICE} ${STP}
# add the bits to setup driver parameters here
for arg in $BRIDGING_OPTS ; do
key=${arg%%=*};
@@ -158,13 +158,13 @@ fi
# If the device is part of a bridge, add the device to the bridge
if [ -n "${BRIDGE}" ] && [ -x /usr/sbin/brctl ]; then
if [ ! -d /sys/class/net/${BRIDGE}/bridge ]; then
- /usr/sbin/brctl addbr ${BRIDGE} 2>/dev/null
+ /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
ethtool_set
[ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
- /usr/sbin/brctl addif ${BRIDGE} ${DEVICE}
+ /usr/sbin/brctl addif -- ${BRIDGE} ${DEVICE}
# add the bits to setup driver parameters here
for arg in $BRIDGING_OPTS ; do
key=${arg%%=*};