From: Jouni Malinen Date: Fri, 5 Nov 2010 16:39:42 +0000 (+0200) Subject: P2P: Clear off_channel_freq when requesting new remain-on-channel X-Git-Tag: hostap-1-bp~895 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09d660b9e3c4b24df6eff8fe409344ef1ad1507a;p=thirdparty%2Fhostap.git P2P: Clear off_channel_freq when requesting new remain-on-channel The driver may end up leaving the current channel when we request a new remain-on-channel and as such, it is better not assume we can start new operations like sending an Action frame on the previous off-channel. --- diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 79bbab36c..eb4b238ec 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -569,9 +569,11 @@ static void wpas_send_action_cb(void *eloop_ctx, void *timeout_ctx) "driver to remain on channel (%u " "MHz) for Action Frame TX", wpa_s->pending_action_freq); - } else + } else { + wpa_s->off_channel_freq = 0; wpa_s->roc_waiting_drv_freq = wpa_s->pending_action_freq; + } } return; } @@ -709,6 +711,7 @@ static int wpas_send_action(void *ctx, unsigned int freq, const u8 *dst, "Frame TX", freq); return -1; } + wpa_s->off_channel_freq = 0; wpa_s->roc_waiting_drv_freq = freq; return 0; @@ -1098,6 +1101,7 @@ static int wpas_start_listen(void *ctx, unsigned int freq, wpa_s->pending_listen_freq = 0; return -1; } + wpa_s->off_channel_freq = 0; wpa_s->roc_waiting_drv_freq = freq; return 0;