Parcourir la source

P2P: Fix remain-on-channel abort race

When the P2P state machine requests a remain- on-channel, there's a
potential race where it can then request a stop before the r-o-c has
actually started, in which case the stop will not be processed. Fix
that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg il y a 14 ans
Parent
commit
6cb22d2fd1
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      wpa_supplicant/p2p_supplicant.c

+ 1 - 1
wpa_supplicant/p2p_supplicant.c

@@ -1048,7 +1048,7 @@ static int wpas_start_listen(void *ctx, unsigned int freq,
 static void wpas_stop_listen(void *ctx)
 {
 	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;