diff options
Diffstat (limited to 'net/mac80211/cfg.c')
| -rw-r--r-- | net/mac80211/cfg.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index de65fe3ed9cc..96496b2c1670 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
| @@ -941,6 +941,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, | |||
| 941 | BSS_CHANGED_P2P_PS | | 941 | BSS_CHANGED_P2P_PS | |
| 942 | BSS_CHANGED_TXPOWER; | 942 | BSS_CHANGED_TXPOWER; |
| 943 | int err; | 943 | int err; |
| 944 | int prev_beacon_int; | ||
| 944 | 945 | ||
| 945 | old = sdata_dereference(sdata->u.ap.beacon, sdata); | 946 | old = sdata_dereference(sdata->u.ap.beacon, sdata); |
| 946 | if (old) | 947 | if (old) |
| @@ -963,6 +964,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, | |||
| 963 | 964 | ||
| 964 | sdata->needed_rx_chains = sdata->local->rx_chains; | 965 | sdata->needed_rx_chains = sdata->local->rx_chains; |
| 965 | 966 | ||
| 967 | prev_beacon_int = sdata->vif.bss_conf.beacon_int; | ||
| 966 | sdata->vif.bss_conf.beacon_int = params->beacon_interval; | 968 | sdata->vif.bss_conf.beacon_int = params->beacon_interval; |
| 967 | 969 | ||
| 968 | if (params->he_cap) | 970 | if (params->he_cap) |
| @@ -974,8 +976,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, | |||
| 974 | if (!err) | 976 | if (!err) |
| 975 | ieee80211_vif_copy_chanctx_to_vlans(sdata, false); | 977 | ieee80211_vif_copy_chanctx_to_vlans(sdata, false); |
| 976 | mutex_unlock(&local->mtx); | 978 | mutex_unlock(&local->mtx); |
| 977 | if (err) | 979 | if (err) { |
| 980 | sdata->vif.bss_conf.beacon_int = prev_beacon_int; | ||
| 978 | return err; | 981 | return err; |
| 982 | } | ||
| 979 | 983 | ||
| 980 | /* | 984 | /* |
| 981 | * Apply control port protocol, this allows us to | 985 | * Apply control port protocol, this allows us to |
| @@ -1490,6 +1494,10 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |||
| 1490 | if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) | 1494 | if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) |
| 1491 | sta->sta.tdls = true; | 1495 | sta->sta.tdls = true; |
| 1492 | 1496 | ||
| 1497 | if (sta->sta.tdls && sdata->vif.type == NL80211_IFTYPE_STATION && | ||
| 1498 | !sdata->u.mgd.associated) | ||
| 1499 | return -EINVAL; | ||
| 1500 | |||
| 1493 | err = sta_apply_parameters(local, sta, params); | 1501 | err = sta_apply_parameters(local, sta, params); |
| 1494 | if (err) { | 1502 | if (err) { |
| 1495 | sta_info_free(local, sta); | 1503 | sta_info_free(local, sta); |
