1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-02-20 07:34:42 +02:00

ignore the bridge option if brctl is not available

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6145 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2007-01-20 15:28:47 +00:00
parent 72f846a97c
commit a2b248eea7

View File

@ -88,21 +88,23 @@ setup_interface() {
# Setup bridging # Setup bridging
case "$iftype" in case "$iftype" in
bridge) bridge)
ifconfig "$iface" up 2>/dev/null >/dev/null [ -x /usr/sbin/brctl ] && {
ifconfig "br-$config" 2>/dev/null >/dev/null && { ifconfig "$iface" up 2>/dev/null >/dev/null
$DEBUG brctl addif "br-$config" "$iface" ifconfig "br-$config" 2>/dev/null >/dev/null && {
return 0 $DEBUG brctl addif "br-$config" "$iface"
} || { return 0
$DEBUG brctl addbr "br-$config" } || {
$DEBUG brctl setfd "br-$config" 0 $DEBUG brctl addbr "br-$config"
$DEBUG brctl addif "br-$config" "$iface" $DEBUG brctl setfd "br-$config" 0
iface="br-$config" $DEBUG brctl addif "br-$config" "$iface"
iface="br-$config"
# need to bring up the bridge and wait a second for # need to bring up the bridge and wait a second for
# it to switch to the 'forwarding' state, otherwise # it to switch to the 'forwarding' state, otherwise
# it will lose its routes... # it will lose its routes...
ifconfig "$iface" up ifconfig "$iface" up
sleep 1 sleep 1
}
} }
;; ;;
esac esac