On Mon, 2009-09-14 at 15:50 +0300, Jouni Malinen wrote: > Taken into account that the AP can even change the Association ID for > the STA during reassociation, I would be fine with dropping the buffered > frames and clearing the PS state when association is completed > successfully (the STA ACKs the (Re)Association Response frame that had > status code 0). I would hope that the authentication frame sequence or > failed (re)association would not touch the PS buffer or state. > > The real time when the association state changes in the AP is when the > ACK frame is received for (Re)Association Response frame. Of the options > you listed, this would be bit after (B), i.e., (C) might be needed to > get the exact timing right. However, I could probably live with (B), > too, in practice. > > But I think, we shouldn't call ap_sta_ps_end as is done for normal PS > > state switching, because that leads to sending buffered frames if any, > > which is undesirable in our case. Instead, we should simply purge of > > buffered frames and clear WLAN_STA_PS. > > This is a very good point and we much indeed make sure we do not end up > sending the buffered frames out based on a new authentication or > association frame. This is especially important for the case when the > frames were buffered in RSNA, Given all this, I still think it would be a lot simpler to just have hostapd remove the station once. johannes