]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: bridge: convert group_addr_set option to a bit
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Wed, 26 Sep 2018 14:01:02 +0000 (17:01 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Sep 2018 17:04:23 +0000 (10:04 -0700)
Convert group_addr_set internal bridge opt to a bit.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_netlink.c
net/bridge/br_private.h
net/bridge/br_sysfs_br.c
net/bridge/br_vlan.c

index 521893df0c2a6618ae15633b34c8d64beeee7f33..b00ccf35c35dead39e4d8a77a9ea5fb132c40471 100644 (file)
@@ -1139,7 +1139,7 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[],
                spin_lock_bh(&br->lock);
                memcpy(br->group_addr, new_addr, sizeof(br->group_addr));
                spin_unlock_bh(&br->lock);
-               br->group_addr_set = true;
+               br_opt_toggle(br, BROPT_GROUP_ADDR_SET, true);
                br_recalculate_fwd_mask(br);
        }
 
index d8eadab09d7d19a5e6d376f0e12bc18fd86efc22..dda117ce386ebf0c1cdcf9044a9efd4a61521fbb 100644 (file)
@@ -312,6 +312,7 @@ enum net_bridge_opts {
        BROPT_NF_CALL_IPTABLES,
        BROPT_NF_CALL_IP6TABLES,
        BROPT_NF_CALL_ARPTABLES,
+       BROPT_GROUP_ADDR_SET,
 };
 
 struct net_bridge {
@@ -355,7 +356,6 @@ struct net_bridge {
        unsigned long                   bridge_ageing_time;
 
        u8                              group_addr[ETH_ALEN];
-       bool                            group_addr_set;
 
        enum {
                BR_NO_STP,              /* no spanning tree */
index 0f8545c94948da24de96a8d5da00b4a16484b15e..4c2d56354d89d51050f8852a161d8a30cc1cee57 100644 (file)
@@ -303,7 +303,7 @@ static ssize_t group_addr_store(struct device *d,
        ether_addr_copy(br->group_addr, new_addr);
        spin_unlock_bh(&br->lock);
 
-       br->group_addr_set = true;
+       br_opt_toggle(br, BROPT_GROUP_ADDR_SET, true);
        br_recalculate_fwd_mask(br);
        netdev_state_change(br->dev);
 
index 61d698bfe2b79e055c8ccbdba43557c96b9d485d..5942e03dd845dd248a485f38a6ce95d24a8b2c56 100644 (file)
@@ -695,7 +695,7 @@ struct net_bridge_vlan *br_vlan_find(struct net_bridge_vlan_group *vg, u16 vid)
 /* Must be protected by RTNL. */
 static void recalculate_group_addr(struct net_bridge *br)
 {
-       if (br->group_addr_set)
+       if (br_opt_get(br, BROPT_GROUP_ADDR_SET))
                return;
 
        spin_lock_bh(&br->lock);