]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Clear off_channel_freq when requesting new remain-on-channel
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 5 Nov 2010 16:39:42 +0000 (18:39 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 5 Nov 2010 16:39:42 +0000 (18:39 +0200)
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.

wpa_supplicant/p2p_supplicant.c

index 79bbab36ca54bffaf7c56dc6fdb767ed0cdb6fdf..eb4b238ec9b76147f70532483da7d17bf8cfb69b 100644 (file)
@@ -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;