mac80211: agg-rx: Accept ADDBA request update if timeout did not change
authorIlan Peer <ilan.peer@intel.com>
Mon, 19 Feb 2018 12:48:44 +0000 (14:48 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 27 Feb 2018 10:06:04 +0000 (11:06 +0100)
As there is no support for updating an existing ADDBA session with
a peer, we decline the request (while keeping the session active).
However, in case that the timeout did not change, there is no need
to decline the request, so modify the code to reply with status success
in such a case (this is useful for interoperability with APs that send an
ADDBA request update without changing the timeout value).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/agg-rx.c

index 1f3188d0384028ef338e86c291441c20493cbcb5..e83c19d4c292e46fce243f60fdf77557096c2af6 100644 (file)
@@ -298,13 +298,23 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta,
 
        if (test_bit(tid, sta->ampdu_mlme.agg_session_valid)) {
                if (sta->ampdu_mlme.tid_rx_token[tid] == dialog_token) {
+                       struct tid_ampdu_rx *tid_rx;
+
                        ht_dbg_ratelimited(sta->sdata,
                                           "updated AddBA Req from %pM on tid %u\n",
                                           sta->sta.addr, tid);
                        /* We have no API to update the timeout value in the
-                        * driver so reject the timeout update.
+                        * driver so reject the timeout update if the timeout
+                        * changed. If if did not change, i.e., no real update,
+                        * just reply with success.
                         */
-                       status = WLAN_STATUS_REQUEST_DECLINED;
+                       rcu_read_lock();
+                       tid_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]);
+                       if (tid_rx && tid_rx->timeout == timeout)
+                               status = WLAN_STATUS_SUCCESS;
+                       else
+                               status = WLAN_STATUS_REQUEST_DECLINED;
+                       rcu_read_unlock();
                        goto end;
                }