AP: Set STA assoc flag in the driver before sending Assoc Resp frame
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Tue, 16 Feb 2016 09:54:33 +0000 (11:54 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 20 Feb 2016 16:25:13 +0000 (18:25 +0200)
commit3f81ac0762a1b99e0b4fcbd38fca0f8da6aa7b03
treed2d1b384162194ab7a68ffa2ffec425cd32fc305
parentbb598c3bdd0616f0c15e1a42e99591d8f3ff3323
AP: Set STA assoc flag in the driver before sending Assoc Resp frame

Previously, stations were added to the driver only after the
(Re)Association Response frame was acked. In the time period between the
station has acked the (Re)Association Response frame and the time the
station was added to the kernel, the station can already start sending
Data frames, which will be dropped by the hardware/driver. In addition
to the data loss, the driver may ignore NDPs with PM bit set from this
STA.

Fix this by setting/adding the STA with associated flag set to the
driver before the AP sends the (Re)Association Response frame with
status success. If the (Re)Association Response frame wasn't acked,
remove the station from the driver.

Note that setting a station to associated state before the non-AP
station acknowledges the (Re)Association Response frame is not compliant
with the IEEE 802.11 standard that specifically states that a non-AP
station should transition to authenticated/associated state only after
it acknowledged the (Re)Association Response frame. However, this is a
justifiable simplification to work around the issue described above since

1. The station will be removed in case it does not acknowledge the
   (Re)Association Response frame.
2. All Data frames would be dropped until the station is set to
   authorized state and there are no known issues with processing the
   other Class 3 frames during the short window before the
   acknowledgement is seen.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
src/ap/ieee802_11.c