blob: 63b21774719bf3010fce427cb276ed2523dbea37 [file] [log] [blame]
developer6a1998b2022-12-08 18:09:45 +08001From b478e06a16a8baa00c5ecc87c1d636981f2206d5 Mon Sep 17 00:00:00 2001
2From: Johannes Berg <johannes.berg@intel.com>
3Date: Tue, 29 Oct 2019 10:25:25 +0100
4Subject: [PATCH] mac80211: sta: randomize BA session dialog token allocator
5
6We currently always start the dialog token generator at zero,
7so the first dialog token we use is always 1. This would be
8OK if we had a perfect guarantee that we always do a proper
9deauth/re-auth handshake, but in IBSS mode this doesn't always
10happen properly.
11
12To make problems with block ack (aggregation) sessions getting
13stuck less likely, randomize the dialog token so if we start a
14new session but the peer still has old state for us, it can
15better detect this.
16
17This is really just a workaround to make things a bit more
18robust than they are now - a better fix would be to do a full
19authentication handshake in IBSS mode upon having discovered a
20new station, and on the receiver resetting the state (removing
21and re-adding the station) on receiving the authentication
22packet.
23
24Signed-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
developer36fe7092023-09-27 12:24:47 +080031@@ -554,6 +554,7 @@ __sta_info_alloc(struct ieee80211_sub_if
developer6a1998b2022-12-08 18:09:45 +080032 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);