set default bridge priority to 0x7FFF
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 23 Apr 2013 14:04:36 +0000 (16:04 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 23 Apr 2013 14:05:14 +0000 (16:05 +0200)
bridge.c
system-linux.c
system.h

index 83c9d792efb63d2a7c6ead746f945f60a066f4ce..a970d50cb3cfad13e09426eec76fddb6ca49cc51 100644 (file)
--- a/bridge.c
+++ b/bridge.c
@@ -464,6 +464,7 @@ bridge_apply_settings(struct bridge_state *bst, struct blob_attr **tb)
        cfg->stp = false;
        cfg->forward_delay = 2;
        cfg->igmp_snoop = true;
+       cfg->priority = 0x7FFF;
 
        if ((cur = tb[BRIDGE_ATTR_STP]))
                cfg->stp = blobmsg_get_bool(cur);
@@ -471,10 +472,8 @@ bridge_apply_settings(struct bridge_state *bst, struct blob_attr **tb)
        if ((cur = tb[BRIDGE_ATTR_FORWARD_DELAY]))
                cfg->forward_delay = blobmsg_get_u32(cur);
 
-       if ((cur = tb[BRIDGE_ATTR_PRIORITY])) {
+       if ((cur = tb[BRIDGE_ATTR_PRIORITY]))
                cfg->priority = blobmsg_get_u32(cur);
-               cfg->flags |= BRIDGE_OPT_PRIORITY;
-       }
 
        if ((cur = tb[BRIDGE_ATTR_IGMP_SNOOP]))
                cfg->igmp_snoop = blobmsg_get_bool(cur);
index 604c206c4526df9c4235d9b574b994475b466252..9d2e92f22b4fa05ed49fdacb42acab5e34685744 100644 (file)
@@ -581,11 +581,9 @@ int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg)
        system_set_dev_sysctl("/sys/devices/virtual/net/%s/bridge/multicast_snooping",
                bridge->ifname, cfg->igmp_snoop ? "1" : "0");
 
-       if (cfg->flags & BRIDGE_OPT_PRIORITY) {
-               args[0] = BRCTL_SET_BRIDGE_PRIORITY;
-               args[1] = cfg->priority;
-               system_bridge_if(bridge->ifname, NULL, SIOCDEVPRIVATE, &args);
-       }
+       args[0] = BRCTL_SET_BRIDGE_PRIORITY;
+       args[1] = cfg->priority;
+       system_bridge_if(bridge->ifname, NULL, SIOCDEVPRIVATE, &args);
 
        if (cfg->flags & BRIDGE_OPT_AGEING_TIME) {
                args[0] = BRCTL_SET_AGEING_TIME;
index 1b16bb900393d58734d865d7390723ca37db3e60..691667cad128deaf08bca2409eda187cce4319a9 100644 (file)
--- a/system.h
+++ b/system.h
@@ -38,7 +38,6 @@ enum bridge_opt {
        BRIDGE_OPT_AGEING_TIME = (1 << 0),
        BRIDGE_OPT_HELLO_TIME  = (1 << 1),
        BRIDGE_OPT_MAX_AGE     = (1 << 2),
-       BRIDGE_OPT_PRIORITY    = (1 << 3),
 };
 
 struct bridge_config {