From: Johannes Berg <johannes.berg@xxxxxxxxx> We currently always start the dialog token generator at zero, so the first dialog token we use is always 1. This would be OK if we had a perfect guarantee that we always do a proper deauth/re-auth handshake, but in IBSS mode this doesn't always happen properly. To make problems with block ack (aggregation) sessions getting stuck less likely, randomize the dialog token so if we start a new session but the peer still has old state for us, it can better detect this. This is really just a workaround to make things a bit more robust than they are now - a better fix would be to do a full authentication handshake in IBSS mode upon having discovered a new station, and on the receiver resetting the state (removing and re-adding the station) on receiving the authentication packet. Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx> --- net/mac80211/sta_info.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index bd11fef2139f..b6c8e6291920 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -324,6 +324,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames); INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work); mutex_init(&sta->ampdu_mlme.mtx); + sta->ampdu_mlme.dialog_token_allocator = prandom_u32_max(U8_MAX); #ifdef CONFIG_MAC80211_MESH if (ieee80211_vif_is_mesh(&sdata->vif)) { sta->mesh = kzalloc(sizeof(*sta->mesh), gfp); -- 2.20.1