]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Force driver to disassociate STA if no room for the STA entry
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 28 May 2012 04:21:37 +0000 (21:21 -0700)
committerJouni Malinen <j@w1.fi>
Mon, 28 May 2012 04:21:37 +0000 (21:21 -0700)
When hostapd (or wpa_supplicant AP mode) limits the maximum number
of STA entries with a driver that implements SME, the driver needs
to be notified of the failed STA addition. Disassociate the STA if
the driver notifies of an association that would go beyond the
maximum number of STAs.

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

src/ap/drv_callbacks.c

index 8d24e087e6b0c853070c41e0c1c1f1499480efb5..4c0d0abac975330521550505f974054ecc6f65a2 100644 (file)
@@ -86,8 +86,11 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
                sta->timeout_next = STA_NULLFUNC;
        } else {
                sta = ap_sta_add(hapd, addr);
-               if (sta == NULL)
+               if (sta == NULL) {
+                       hostapd_drv_sta_disassoc(hapd, addr,
+                                                WLAN_REASON_DISASSOC_AP_BUSY);
                        return -1;
+               }
        }
        sta->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS | WLAN_STA_WPS2);