Allow AP to disconnect STA without sending Deauth/Disassoc frame
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 8 Apr 2016 16:18:33 +0000 (19:18 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 8 Apr 2016 21:30:49 +0000 (00:30 +0300)
The optional tx=0 parameter can be added to the hostapd
DEAUTHENTICATE/DISASSOCIATE command to request disconnection without
transmitting the Deauthentication/Disassociation frame to the STA.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/ctrl_iface_ap.c

index 8a9965b..fffb175 100644 (file)
@@ -352,7 +352,10 @@ int hostapd_ctrl_iface_deauthenticate(struct hostapd_data *hapd,
        }
 #endif /* CONFIG_P2P_MANAGER */
 
-       hostapd_drv_sta_deauth(hapd, addr, reason);
+       if (os_strstr(txtaddr, " tx=0"))
+               hostapd_drv_sta_remove(hapd, addr);
+       else
+               hostapd_drv_sta_deauth(hapd, addr, reason);
        sta = ap_get_sta(hapd, addr);
        if (sta)
                ap_sta_deauthenticate(hapd, sta, reason);
@@ -412,7 +415,10 @@ int hostapd_ctrl_iface_disassociate(struct hostapd_data *hapd,
        }
 #endif /* CONFIG_P2P_MANAGER */
 
-       hostapd_drv_sta_disassoc(hapd, addr, reason);
+       if (os_strstr(txtaddr, " tx=0"))
+               hostapd_drv_sta_remove(hapd, addr);
+       else
+               hostapd_drv_sta_disassoc(hapd, addr, reason);
        sta = ap_get_sta(hapd, addr);
        if (sta)
                ap_sta_disassociate(hapd, sta, reason);