Skip to content

Commit

Permalink
bridge: mdb: fix vlan_enabled access when vlans are not configured
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nikolay Aleksandrov authored and David S. Miller committed Aug 3, 2015
1 parent a5c90b2 commit 58da018
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bridge/br_mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 58da018

Please sign in to comment.