From: Jouni Malinen Date: Fri, 5 Nov 2010 16:39:15 +0000 (+0200) Subject: P2P: Cancel pending remain-on-channel request when stopping Listen X-Git-Tag: hostap-1-bp~896 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8eada5ca139e09bbf14362e43cccabe4c244521a;p=thirdparty%2Fhostap.git P2P: Cancel pending remain-on-channel request when stopping Listen If we have already asked the driver to start a new remain-on-channel, we need to cancel it even if the actual remain-on-channel has not yet started at the point when a new operation or timeout etc. triggers Listen state to be stopped. --- diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index f082eeff7..79bbab36c 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -721,7 +721,7 @@ 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->off_channel_freq) { + 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; @@ -995,7 +995,7 @@ void wpas_go_neg_completed(void *ctx, struct p2p_go_neg_results *res) { struct wpa_supplicant *wpa_s = ctx; - if (wpa_s->off_channel_freq) { + 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;