hostapd:Avoid disassociation getting in to a loop by moving
timeout_next changes to hostapd_new_assoc_sta()

Problem:
STA's connectivity state machine gets into a loop of sending
disassociation, for previously disassociating STA when no ACK
is received for Association Response within ap_handle_timer timeout.

To Fix this issue, move the
    sta->timeout_next = STA_NULLFUNC;
from handle_assoc() to hostapd_new_assoc_sta().

sta->timeout_next is set to STA_NULLFUNC only when Ack is received
for the Association Response sent out. So if ACK is not received
within AP_DEAUTH_DELAY, STA is deauthenticated and STA context is
cleaned up. Due to which there needs to be a new session started
by STA with AUTH Req.

BUG:b:38196747
TEST:Tested through simulating below test procedure
1) After getting Disassociation from STA, within ap_handle_timer
expires(1 sec) made STA to Associate back.
2) After sending successful Assoc Resp frame from AP, simulated the
case where acknowledgement for Assoc Resp being not received by AP.

Below Stress test done on both guest and primary modes:
1. Connect Nexus 5x,Nexus 6S and Surface Pro to Guest/Primary Network
2. Open Youtube and play HD Videos in Nexus 5x
3. Open "http://flywheelcoffee.com" from Surface Pro
4. Open " https://thousandeyes.okta.com" from Nexus-6p

Change-Id: I5bb8ca3573c7f9bc418cc303a74d27c3b70512bc
Reviewed-on: https://chromium-review.googlesource.com/485879
Commit-Ready: Dheeraj KM <dheeraj.km@globaledgesoft.com>
Tested-by: Dheeraj KM <dheeraj.km@globaledgesoft.com>
Reviewed-by: Srinivasa duvvuri <sduvvuri@chromium.org>
2 files changed