P2P: Fix send_action_in_progress clearing in corner cases
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 9 Feb 2015 22:41:27 +0000 (00:41 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 9 Feb 2015 22:41:27 +0000 (00:41 +0200)
commit0d2f324d670404152e8d28303463ef9684c9f3f9
tree18a30df0e148cb8c5a37cfef2f00172344914ebc
parentc5b535ed1d02dec85e7260a81851b49131afd27d
P2P: Fix send_action_in_progress clearing in corner cases

It is possible for an Action frame TX operation to be stopped in a way
that results in the TX status callback function not being called. This
could happen, e.g., when P2P_STOP_FIND was issued while waiting for PD
Response TX status. This specific case ended in leaving
p2p->send_action_in_progress set to 1 and that ending up stopping a
future TX operation when p2p_send_action_cb() gets called with
p2p->pending_action_state == P2P_NO_PENDING_ACTION.

This could result in reception of a fragmented service discovery
response failing due to the GAS sequence getting stopped when receiving
TX callback for the first GAS comeback request. That sequence could be
hit in mac80211_hwsim tests when p2p_listen_and_offchannel_tx was
followed by p2p_service_discovery_fragmentation (even after a long time
since this was on dev1 and there could be even 10 minutes between these
test cases).

Fix this issue by clearing send_action_in_progress whenever stopping
pending P2P operation with p2p_stop_find (or P2P_FLUSH for that matter).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/p2p/p2p.c