diff options
| author | Bill Nottingham <notting@redhat.com> | 2006-06-30 20:02:42 +0000 |
|---|---|---|
| committer | Bill Nottingham <notting@redhat.com> | 2006-06-30 20:02:42 +0000 |
| commit | 98ff30f0077b9fe78ba1ddda1dc7cc6faaa17188 (patch) | |
| tree | 49bd05bca4723cf3f80cb2fe2bffb217ab5548c0 /sysconfig/network-scripts/ifup-eth | |
| parent | 4d0100d922a1935a23ec5ba826fc2cea60d3d41f (diff) | |
backport bridge fixes (#187100)
Diffstat (limited to 'sysconfig/network-scripts/ifup-eth')
| -rwxr-xr-x | sysconfig/network-scripts/ifup-eth | 35 |
1 files changed, 19 insertions, 16 deletions
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} |
