[package] sync macs with vif bssids in broadcom.sh, fixes multi-ssid with wpa
[openwrt.git] / package / base-files / files / lib / network / config.sh
index 52e50b1..29b7fe5 100755 (executable)
@@ -90,8 +90,8 @@ prepare_interface() {
        [ "br-$config" = "$iface" -o -e "$iface" ] && return 0;
        
        ifconfig "$iface" 2>/dev/null >/dev/null && {
-               # make sure the interface is removed from any existing bridge and brought down
-               ifconfig "$iface" down
+               # make sure the interface is removed from any existing bridge and deconfigured 
+               ifconfig "$iface" 0.0.0.0
                unbridge "$iface"
        }
 
@@ -120,7 +120,7 @@ prepare_interface() {
                                        $DEBUG brctl setfd "br-$config" 0
                                        $DEBUG ifconfig "br-$config" up
                                        $DEBUG brctl addif "br-$config" "$iface"
-                                       $DEBUG brctl stp "br-$config" ${stp:-off}
+                                       $DEBUG brctl stp "br-$config" ${stp:-0}
                                        # Creating the bridge here will have triggered a hotplug event, which will
                                        # result in another setup_interface() call, so we simply stop processing
                                        # the current event at this point.
@@ -143,7 +143,7 @@ set_interface_ifname() {
 }
 
 setup_interface_none() {
-       env -i ACTION="ifup" INTERFACE="$config" DEVICE="$iface" PROTO=none /sbin/hotplug-call "iface" &
+       env -i ACTION="ifup" INTERFACE="$2" DEVICE="$1" PROTO=none /sbin/hotplug-call "iface" &
 }
 
 setup_interface_static() {
@@ -231,7 +231,9 @@ setup_interface() {
        # Interface settings
        config_get mtu "$config" mtu
        config_get macaddr "$config" macaddr
+       macaddr="${macaddr:-$3}"
        grep "$iface:" /proc/net/dev > /dev/null && \
+               $DEBUG ifconfig "$iface" down && \
                $DEBUG ifconfig "$iface" ${macaddr:+hw ether "$macaddr"} ${mtu:+mtu $mtu} up
        set_interface_ifname "$config" "$iface"
 
This page took 0.027132 seconds and 4 git commands to generate.