mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 15:32:33 +00:00
ignore the bridge option if brctl is not available
SVN-Revision: 6145
This commit is contained in:
parent
ee7132b9df
commit
857d350bc7
@ -88,21 +88,23 @@ setup_interface() {
|
||||
# Setup bridging
|
||||
case "$iftype" in
|
||||
bridge)
|
||||
ifconfig "$iface" up 2>/dev/null >/dev/null
|
||||
ifconfig "br-$config" 2>/dev/null >/dev/null && {
|
||||
$DEBUG brctl addif "br-$config" "$iface"
|
||||
return 0
|
||||
} || {
|
||||
$DEBUG brctl addbr "br-$config"
|
||||
$DEBUG brctl setfd "br-$config" 0
|
||||
$DEBUG brctl addif "br-$config" "$iface"
|
||||
iface="br-$config"
|
||||
[ -x /usr/sbin/brctl ] && {
|
||||
ifconfig "$iface" up 2>/dev/null >/dev/null
|
||||
ifconfig "br-$config" 2>/dev/null >/dev/null && {
|
||||
$DEBUG brctl addif "br-$config" "$iface"
|
||||
return 0
|
||||
} || {
|
||||
$DEBUG brctl addbr "br-$config"
|
||||
$DEBUG brctl setfd "br-$config" 0
|
||||
$DEBUG brctl addif "br-$config" "$iface"
|
||||
iface="br-$config"
|
||||
|
||||
# need to bring up the bridge and wait a second for
|
||||
# it to switch to the 'forwarding' state, otherwise
|
||||
# it will lose its routes...
|
||||
ifconfig "$iface" up
|
||||
sleep 1
|
||||
# need to bring up the bridge and wait a second for
|
||||
# it to switch to the 'forwarding' state, otherwise
|
||||
# it will lose its routes...
|
||||
ifconfig "$iface" up
|
||||
sleep 1
|
||||
}
|
||||
}
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user