Skip to content

Commit

Permalink
net: bridge: mst: Restrict info size queries to bridge ports
Browse files Browse the repository at this point in the history
Ensure that no bridge masters are ever considered for MST info
dumping. MST states are only supported on bridge ports, not bridge
masters - which br_mst_info_size relies on.

Fixes: 122c294 ("net: bridge: mst: Support setting and reporting MST port states")
Signed-off-by: Tobias Waldekranz <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
wkz authored and kuba-moo committed Mar 23, 2022
1 parent 4a6806c commit a911ad1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bridge/br_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static size_t br_get_link_af_size_filtered(const struct net_device *dev,
/* Each VLAN is returned in bridge_vlan_info along with flags */
vinfo_sz += num_vlan_infos * nla_total_size(sizeof(struct bridge_vlan_info));

if (vg && (filter_mask & RTEXT_FILTER_MST))
if (p && vg && (filter_mask & RTEXT_FILTER_MST))
vinfo_sz += br_mst_info_size(vg);

if (!(filter_mask & RTEXT_FILTER_CFM_STATUS))
Expand Down

0 comments on commit a911ad1

Please sign in to comment.