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);
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);
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;
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 {