Browse Source

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.
Jouni Malinen 14 years ago
parent
commit
8eada5ca13
1 changed files with 2 additions and 2 deletions
  1. 2 2
      wpa_supplicant/p2p_supplicant.c

+ 2 - 2
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;