Commit be3664a0 authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by David S. Miller

net: bridge: convert group_addr_set option to a bit

Convert group_addr_set internal bridge opt to a bit.
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Reviewed-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8df3510f
...@@ -1139,7 +1139,7 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[], ...@@ -1139,7 +1139,7 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[],
spin_lock_bh(&br->lock); spin_lock_bh(&br->lock);
memcpy(br->group_addr, new_addr, sizeof(br->group_addr)); memcpy(br->group_addr, new_addr, sizeof(br->group_addr));
spin_unlock_bh(&br->lock); spin_unlock_bh(&br->lock);
br->group_addr_set = true; br_opt_toggle(br, BROPT_GROUP_ADDR_SET, true);
br_recalculate_fwd_mask(br); br_recalculate_fwd_mask(br);
} }
......
...@@ -312,6 +312,7 @@ enum net_bridge_opts { ...@@ -312,6 +312,7 @@ enum net_bridge_opts {
BROPT_NF_CALL_IPTABLES, BROPT_NF_CALL_IPTABLES,
BROPT_NF_CALL_IP6TABLES, BROPT_NF_CALL_IP6TABLES,
BROPT_NF_CALL_ARPTABLES, BROPT_NF_CALL_ARPTABLES,
BROPT_GROUP_ADDR_SET,
}; };
struct net_bridge { struct net_bridge {
...@@ -355,7 +356,6 @@ struct net_bridge { ...@@ -355,7 +356,6 @@ struct net_bridge {
unsigned long bridge_ageing_time; unsigned long bridge_ageing_time;
u8 group_addr[ETH_ALEN]; u8 group_addr[ETH_ALEN];
bool group_addr_set;
enum { enum {
BR_NO_STP, /* no spanning tree */ BR_NO_STP, /* no spanning tree */
......
...@@ -303,7 +303,7 @@ static ssize_t group_addr_store(struct device *d, ...@@ -303,7 +303,7 @@ static ssize_t group_addr_store(struct device *d,
ether_addr_copy(br->group_addr, new_addr); ether_addr_copy(br->group_addr, new_addr);
spin_unlock_bh(&br->lock); spin_unlock_bh(&br->lock);
br->group_addr_set = true; br_opt_toggle(br, BROPT_GROUP_ADDR_SET, true);
br_recalculate_fwd_mask(br); br_recalculate_fwd_mask(br);
netdev_state_change(br->dev); netdev_state_change(br->dev);
......
...@@ -695,7 +695,7 @@ struct net_bridge_vlan *br_vlan_find(struct net_bridge_vlan_group *vg, u16 vid) ...@@ -695,7 +695,7 @@ struct net_bridge_vlan *br_vlan_find(struct net_bridge_vlan_group *vg, u16 vid)
/* Must be protected by RTNL. */ /* Must be protected by RTNL. */
static void recalculate_group_addr(struct net_bridge *br) static void recalculate_group_addr(struct net_bridge *br)
{ {
if (br->group_addr_set) if (br_opt_get(br, BROPT_GROUP_ADDR_SET))
return; return;
spin_lock_bh(&br->lock); spin_lock_bh(&br->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment