From 0f0fa4f1c8cb4f793c3dddd1edd1420483e9e325 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 23 Apr 2013 16:04:36 +0200 Subject: [PATCH] set default bridge priority to 0x7FFF --- bridge.c | 5 ++--- system-linux.c | 8 +++----- system.h | 1 - 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/bridge.c b/bridge.c index 83c9d79..a970d50 100644 --- 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); diff --git a/system-linux.c b/system-linux.c index 604c206..9d2e92f 100644 --- a/system-linux.c +++ b/system-linux.c @@ -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; diff --git a/system.h b/system.h index 1b16bb9..691667c 100644 --- 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 { -- 2.25.1