Turn on stp by default for bridges (#2476)
authorFlorian Fainelli <florian@openwrt.org>
Thu, 18 Oct 2007 13:07:28 +0000 (13:07 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Thu, 18 Oct 2007 13:07:28 +0000 (13:07 +0000)
SVN-Revision: 9343

package/base-files/files/etc/config/network
package/base-files/files/lib/network/config.sh

index a35fd2e..5d380d1 100644 (file)
@@ -12,3 +12,4 @@ config interface lan
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0
+       option stp      on
index 81b60f7..e750c8a 100755 (executable)
@@ -88,6 +88,7 @@ prepare_interface() {
 
        # Setup bridging
        config_get iftype "$config" type
+       config_get stp "$config" stp
        case "$iftype" in
                bridge)
                        [ -x /usr/sbin/brctl ] && {
@@ -99,6 +100,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:-on}
                                        # 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.