bridge: mdb: fix vlan_enabled access when vlans are not configured
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Mon, 3 Aug 2015 23:19:58 +0000 (01:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Aug 2015 23:20:51 +0000 (16:20 -0700)
Instead of trying to access br->vlan_enabled directly use the provided
helper br_vlan_enabled().

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_mdb.c

index 1df3ef4a73b955e7e159e5481c3b9d21c9730da5..d747275fad18826f96c604505f0583049c456f91 100644 (file)
@@ -490,7 +490,7 @@ static int br_mdb_add(struct sk_buff *skb, struct nlmsghdr *nlh)
                return -EINVAL;
 
        pv = nbp_get_vlan_info(p);
-       if (br->vlan_enabled && pv && entry->vid == 0) {
+       if (br_vlan_enabled(br) && pv && entry->vid == 0) {
                for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID) {
                        entry->vid = vid;
                        err = __br_mdb_add(net, br, entry);
@@ -592,7 +592,7 @@ static int br_mdb_del(struct sk_buff *skb, struct nlmsghdr *nlh)
                return -EINVAL;
 
        pv = nbp_get_vlan_info(p);
-       if (br->vlan_enabled && pv && entry->vid == 0) {
+       if (br_vlan_enabled(br) && pv && entry->vid == 0) {
                for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID) {
                        entry->vid = vid;
                        err = __br_mdb_del(br, entry);