Commit a911ad18 authored by Tobias Waldekranz's avatar Tobias Waldekranz Committed by Jakub Kicinski

net: bridge: mst: Restrict info size queries to bridge ports

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: 122c2948 ("net: bridge: mst: Support setting and reporting MST port states")
Signed-off-by: default avatarTobias Waldekranz <tobias@waldekranz.com>
Link: https://lore.kernel.org/r/20220322133001.16181-1-tobias@waldekranz.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 4a6806cf
...@@ -119,7 +119,7 @@ static size_t br_get_link_af_size_filtered(const struct net_device *dev, ...@@ -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 */ /* Each VLAN is returned in bridge_vlan_info along with flags */
vinfo_sz += num_vlan_infos * nla_total_size(sizeof(struct bridge_vlan_info)); 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); vinfo_sz += br_mst_info_size(vg);
if (!(filter_mask & RTEXT_FILTER_CFM_STATUS)) if (!(filter_mask & RTEXT_FILTER_CFM_STATUS))
......
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