]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Ignore connect/roam/disconnect events when using SME
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 4 Sep 2009 13:39:41 +0000 (16:39 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 4 Sep 2009 13:39:41 +0000 (16:39 +0300)
Getting double association/disassociation events can get core code
confused, so better filter out the extra events.

src/drivers/driver_nl80211.c

index 118c395a00d81217479e83d10f6abc600281c5c1..fd1256d643e4674ce2f68929b8768b2829dd7c33 100644 (file)
@@ -748,6 +748,16 @@ static void mlme_event_connect(struct wpa_driver_nl80211_data *drv,
 {
        union wpa_event_data event;
 
+       if (drv->capa.flags & WPA_DRIVER_FLAGS_SME) {
+               /*
+                * Avoid reporting two association events that would confuse
+                * the core code.
+                */
+               wpa_printf(MSG_DEBUG, "nl80211: Ignore connect event (cmd=%d) "
+                          "when using userspace SME", cmd);
+               return;
+       }
+
        os_memset(&event, 0, sizeof(event));
        if (cmd == NL80211_CMD_CONNECT &&
            nla_get_u16(status) != WLAN_STATUS_SUCCESS) {
@@ -940,6 +950,15 @@ static int process_event(struct nl_msg *msg, void *arg)
                                   tb[NL80211_ATTR_RESP_IE]);
                break;
        case NL80211_CMD_DISCONNECT:
+               if (drv->capa.flags & WPA_DRIVER_FLAGS_SME) {
+                       /*
+                        * Avoid reporting two disassociation events that could
+                        * confuse the core code.
+                        */
+                       wpa_printf(MSG_DEBUG, "nl80211: Ignore disconnect "
+                                  "event when using userspace SME");
+                       break;
+               }
                drv->associated = 0;
                wpa_supplicant_event(drv->ctx, EVENT_DISASSOC, NULL);
                break;