2024-05-15 11:34:59

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] wifi: mac80211: apply mcast rate only if interface is up

From: Johannes Berg <[email protected]>

If the interface isn't enabled, don't apply multicast
rate changes immediately.

Reported-by: [email protected]
Signed-off-by: Johannes Berg <[email protected]>
---
net/mac80211/cfg.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index b08e5d7687e3..99abbb9e8477 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2958,8 +2958,9 @@ static int ieee80211_set_mcast_rate(struct wiphy *wiphy, struct net_device *dev,
memcpy(sdata->vif.bss_conf.mcast_rate, rate,
sizeof(int) * NUM_NL80211_BANDS);

- ieee80211_link_info_change_notify(sdata, &sdata->deflink,
- BSS_CHANGED_MCAST_RATE);
+ if (ieee80211_sdata_running(sdata))
+ ieee80211_link_info_change_notify(sdata, &sdata->deflink,
+ BSS_CHANGED_MCAST_RATE);

return 0;
}
--
2.45.0