d09d70725e5516449ea281680cdb8c1dfdc68726
[openwrt/staging/nbd.git] /
1 From b478e06a16a8baa00c5ecc87c1d636981f2206d5 Mon Sep 17 00:00:00 2001
2 From: Johannes Berg <johannes.berg@intel.com>
3 Date: Tue, 29 Oct 2019 10:25:25 +0100
4 Subject: [PATCH] mac80211: sta: randomize BA session dialog token allocator
5
6 We currently always start the dialog token generator at zero,
7 so the first dialog token we use is always 1. This would be
8 OK if we had a perfect guarantee that we always do a proper
9 deauth/re-auth handshake, but in IBSS mode this doesn't always
10 happen properly.
11
12 To make problems with block ack (aggregation) sessions getting
13 stuck less likely, randomize the dialog token so if we start a
14 new session but the peer still has old state for us, it can
15 better detect this.
16
17 This is really just a workaround to make things a bit more
18 robust than they are now - a better fix would be to do a full
19 authentication handshake in IBSS mode upon having discovered a
20 new station, and on the receiver resetting the state (removing
21 and re-adding the station) on receiving the authentication
22 packet.
23
24 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
25 ---
26 net/mac80211/sta_info.c | 1 +
27 1 file changed, 1 insertion(+)
28
29 --- a/net/mac80211/sta_info.c
30 +++ b/net/mac80211/sta_info.c
31 @@ -357,6 +357,7 @@ struct sta_info *sta_info_alloc(struct i
32 INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames);
33 INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
34 mutex_init(&sta->ampdu_mlme.mtx);
35 + sta->ampdu_mlme.dialog_token_allocator = prandom_u32_max(U8_MAX);
36 #ifdef CPTCFG_MAC80211_MESH
37 if (ieee80211_vif_is_mesh(&sdata->vif)) {
38 sta->mesh = kzalloc(sizeof(*sta->mesh), gfp);