From: Dan Kenigsberg <danken(a)redhat.com>
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(a)redhat.com>
---
sysconfig/network-scripts/ifdown-eth | 4 ++--
sysconfig/network-scripts/ifup-eth | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index 80b9954..2be4eb6 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -107,12 +107,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 79669c0..3c88eb7 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}
fi
# If the device is a tap device, create it with tunctl, if available.
@@ -147,7 +147,7 @@ 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
@@ -155,7 +155,7 @@ if [ -n "${BRIDGE}" ] && [ -x /usr/sbin/brctl ];
then
/sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
fi
[ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
- /usr/sbin/brctl addif ${BRIDGE} ${DEVICE}
+ /usr/sbin/brctl addif -- ${BRIDGE} ${DEVICE}
# Upon adding a device to 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)
--
1.7.7.6
Show replies by date
y(a)redhat.com (y(a)redhat.com) said:
From: Dan Kenigsberg <danken(a)redhat.com>
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.
Thanks, applied.
Bill