fix a race condition with broadcom wl devices in a bridge
[openwrt-10.03/.git] / package / base-files / files / lib / network / config.sh
index c6d909fd0aaf25b6a34b9f173dbd4707c430fe83..c08fd69bc8f615dc2040919a6fb6816eb86ee21f 100755 (executable)
@@ -98,6 +98,7 @@ prepare_interface() {
                                } || {
                                        $DEBUG brctl addbr "br-$config"
                                        $DEBUG brctl setfd "br-$config" 0
+                                       $DEBUG ifconfig "br-$config" up
                                        $DEBUG brctl addif "br-$config" "$iface"
                                        # Creating the bridge here will have triggered a hotplug event, which will
                                        # result in another setup_interface() call, so we simply stop processing
@@ -149,10 +150,9 @@ setup_interface() {
                        config_get dns "$config" dns
                        config_get bcast "$config" broadcast
                        
-                       [ -z "$ipaddr" ] || $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask"
+                       [ -z "$ipaddr" ] || $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask" broadcast "${bcast:-+}"
                        [ -z "$ip6addr" ] || $DEBUG ifconfig "$iface" add "$ip6addr"
                        [ -z "$gateway" ] || $DEBUG route add default gw "$gateway"
-                       [ -z "$bcast" ] || $DEBUG ifconfig "$iface" broadcast "$bcast"
                        [ -z "$dns" ] || {
                                for ns in $dns; do
                                        grep "$ns" /tmp/resolv.conf.auto 2>/dev/null >/dev/null || {