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

bridge: mdb: fix vlan_enabled access when vlans are not configured

Instead of trying to access br->vlan_enabled directly use the provided
helper br_vlan_enabled().
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a5c90b29
...@@ -490,7 +490,7 @@ static int br_mdb_add(struct sk_buff *skb, struct nlmsghdr *nlh) ...@@ -490,7 +490,7 @@ static int br_mdb_add(struct sk_buff *skb, struct nlmsghdr *nlh)
return -EINVAL; return -EINVAL;
pv = nbp_get_vlan_info(p); 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) { for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID) {
entry->vid = vid; entry->vid = vid;
err = __br_mdb_add(net, br, entry); err = __br_mdb_add(net, br, entry);
...@@ -592,7 +592,7 @@ static int br_mdb_del(struct sk_buff *skb, struct nlmsghdr *nlh) ...@@ -592,7 +592,7 @@ static int br_mdb_del(struct sk_buff *skb, struct nlmsghdr *nlh)
return -EINVAL; return -EINVAL;
pv = nbp_get_vlan_info(p); 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) { for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID) {
entry->vid = vid; entry->vid = vid;
err = __br_mdb_del(br, entry); err = __br_mdb_del(br, entry);
......
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