P2P: Fix action done handling for driver-based off-channel TX
authorJohannes Berg <johannes.berg@intel.com>
Tue, 20 Sep 2011 09:59:09 +0000 (11:59 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 21 Sep 2011 21:57:27 +0000 (00:57 +0300)
The action done handling needs to abort an off-channel period since one
might have been used for example for GO negotiation and after action
done the code assumes it can start a new off-channel period.

This fixes a bug I introduced when adding support for
in-kernel off-channel transmissions.

Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
wpa_supplicant/p2p_supplicant.c

index 3b4e887..f0451d2 100644 (file)
@@ -816,11 +816,11 @@ static void wpas_send_action_done(void *ctx)
        wpa_printf(MSG_DEBUG, "P2P: Action frame sequence done notification");
        wpabuf_free(wpa_s->pending_action_tx);
        wpa_s->pending_action_tx = NULL;
-       if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) {
-               if (wpa_s->action_tx_wait_time)
-                       wpa_drv_send_action_cancel_wait(wpa_s);
-               wpa_s->off_channel_freq = 0;
-       } else if (wpa_s->off_channel_freq || wpa_s->roc_waiting_drv_freq) {
+       if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX &&
+           wpa_s->action_tx_wait_time)
+               wpa_drv_send_action_cancel_wait(wpa_s);
+
+       if (wpa_s->off_channel_freq || wpa_s->roc_waiting_drv_freq) {
                wpa_drv_cancel_remain_on_channel(wpa_s);
                wpa_s->off_channel_freq = 0;
                wpa_s->roc_waiting_drv_freq = 0;