summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTobias Waldekranz <tobias@waldekranz.com>2022-03-22 16:30:01 +0300
committerJakub Kicinski <kuba@kernel.org>2022-03-23 20:32:44 +0300
commita911ad18a56aeecf87a098ad1cdc4de91d7f60de (patch)
tree62e869b5ff3256e93d77a60aab2fc28c38158bec /net
parent4a6806cfcbca2cd7bae94b2d4244dab3aaa1b333 (diff)
downloadlinux-a911ad18a56aeecf87a098ad1cdc4de91d7f60de.tar.xz
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: 122c29486e1f ("net: bridge: mst: Support setting and reporting MST port states") Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com> Link: https://lore.kernel.org/r/20220322133001.16181-1-tobias@waldekranz.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/bridge/br_netlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 204472449ec9..200ad05b296f 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -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))