aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index a1c6e1ceede8..082f270b5912 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1765,6 +1765,7 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh,
1765 /* mcast rate setting in Mesh Node */ 1765 /* mcast rate setting in Mesh Node */
1766 memcpy(sdata->vif.bss_conf.mcast_rate, setup->mcast_rate, 1766 memcpy(sdata->vif.bss_conf.mcast_rate, setup->mcast_rate,
1767 sizeof(setup->mcast_rate)); 1767 sizeof(setup->mcast_rate));
1768 sdata->vif.bss_conf.basic_rates = setup->basic_rates;
1768 1769
1769 sdata->vif.bss_conf.beacon_int = setup->beacon_interval; 1770 sdata->vif.bss_conf.beacon_int = setup->beacon_interval;
1770 sdata->vif.bss_conf.dtim_period = setup->dtim_period; 1771 sdata->vif.bss_conf.dtim_period = setup->dtim_period;
@@ -1877,6 +1878,8 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
1877 if (_chg_mesh_attr(NL80211_MESHCONF_AWAKE_WINDOW, mask)) 1878 if (_chg_mesh_attr(NL80211_MESHCONF_AWAKE_WINDOW, mask))
1878 conf->dot11MeshAwakeWindowDuration = 1879 conf->dot11MeshAwakeWindowDuration =
1879 nconf->dot11MeshAwakeWindowDuration; 1880 nconf->dot11MeshAwakeWindowDuration;
1881 if (_chg_mesh_attr(NL80211_MESHCONF_PLINK_TIMEOUT, mask))
1882 conf->plink_timeout = nconf->plink_timeout;
1880 ieee80211_mbss_info_change_notify(sdata, BSS_CHANGED_BEACON); 1883 ieee80211_mbss_info_change_notify(sdata, BSS_CHANGED_BEACON);
1881 return 0; 1884 return 0;
1882} 1885}
@@ -2844,6 +2847,12 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
2844 return -EOPNOTSUPP; 2847 return -EOPNOTSUPP;
2845 } 2848 }
2846 2849
2850 /* configurations requiring offchan cannot work if no channel has been
2851 * specified
2852 */
2853 if (need_offchan && !chan)
2854 return -EINVAL;
2855
2847 mutex_lock(&local->mtx); 2856 mutex_lock(&local->mtx);
2848 2857
2849 /* Check if the operating channel is the requested channel */ 2858 /* Check if the operating channel is the requested channel */
@@ -2853,10 +2862,15 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
2853 rcu_read_lock(); 2862 rcu_read_lock();
2854 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); 2863 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
2855 2864
2856 if (chanctx_conf) 2865 if (chanctx_conf) {
2857 need_offchan = chan != chanctx_conf->def.chan; 2866 need_offchan = chan && (chan != chanctx_conf->def.chan);
2858 else 2867 } else if (!chan) {
2868 ret = -EINVAL;
2869 rcu_read_unlock();
2870 goto out_unlock;
2871 } else {
2859 need_offchan = true; 2872 need_offchan = true;
2873 }
2860 rcu_read_unlock(); 2874 rcu_read_unlock();
2861 } 2875 }
2862 2876