]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Ignore disassociation event in wpa_supplicant AP mode
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 21 Dec 2011 11:36:13 +0000 (13:36 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 21 Dec 2011 11:36:13 +0000 (13:36 +0200)
If the driver was associated in station mode just before the AP mode was
started, the station mode disassociation event may end up getting
delivered to wpa_supplicant only after the AP mode has been started.
This can result in unexpected attempt to reassociate back to the network
that was previously used in station mode. Avoid this by ignoring the
disassociation event.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/events.c

index ef9e1c3017c8ec38c0ffa492e9afd562f8a0292f..fd04ad2e75116a7795f112e9e3e20831f9fcabd8 100644 (file)
@@ -2039,6 +2039,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                                               data->disassoc_info.addr);
                        break;
                }
+               if (wpa_s->ap_iface) {
+                       wpa_dbg(wpa_s, MSG_DEBUG, "Ignore disassoc event in "
+                               "AP mode");
+                       break;
+               }
 #endif /* CONFIG_AP */
                if (data) {
                        reason_code = data->disassoc_info.reason_code;
@@ -2088,6 +2093,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                                               data->deauth_info.addr);
                        break;
                }
+               if (wpa_s->ap_iface) {
+                       wpa_dbg(wpa_s, MSG_DEBUG, "Ignore deauth event in "
+                               "AP mode");
+                       break;
+               }
 #endif /* CONFIG_AP */
                wpa_supplicant_event_disassoc(wpa_s, reason_code);
                break;