hostapd: Disassoc STA without WPA/RSN IE if AP proto is WPA/RSN

Message ID 41b1fefe9ea4e9ed0e817ec64bdb3b4e@codeaurora.org
State Accepted
Headers show
Series
  • hostapd: Disassoc STA without WPA/RSN IE if AP proto is WPA/RSN
Related show

Commit Message

huw@codeaurora.org Oct. 25, 2017, 11:51 a.m.
Author: Hu Wang <huw@codeaurora.org>
Date:   Wed Oct 25 19:41:00 2017 +0800

     hostapd: Disassoc STA without WPA/RSN IE if AP proto is WPA/RSN

     With the AP proto configured being WPA/RSN and SME in the
     driver, the current implementation in hostapd is to not
     process hostapd_notif_assoc due to "No WPA/RSN IE from STA",
     if the (Re)Association request frame is without the WPA/RSN IE's.

     Enhance the current implementation to disassoc such station,
     provided the AP is not in WPS.

     Signed-off-by: Hu Wang <huw@codeaurora.org>

                 if (hapd->conf->wps_state && ie[0] == 0xdd && ie[1] >= 4 
&&

Comments

Jouni Malinen Nov. 23, 2017, 7:41 p.m. | #1
On Wed, Oct 25, 2017 at 07:51:09PM +0800, huw@codeaurora.org wrote:
>     hostapd: Disassoc STA without WPA/RSN IE if AP proto is WPA/RSN
> 
>     With the AP proto configured being WPA/RSN and SME in the
>     driver, the current implementation in hostapd is to not
>     process hostapd_notif_assoc due to "No WPA/RSN IE from STA",
>     if the (Re)Association request frame is without the WPA/RSN IE's.
> 
>     Enhance the current implementation to disassoc such station,
>     provided the AP is not in WPS.

Thanks, applied with some cleanup.

Patch

diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index ffa8bf1..944f155 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -262,7 +262,8 @@  int hostapd_notif_assoc(struct hostapd_data *hapd, 
const u8 *addr,
  #endif /* CONFIG_WPS */

                         wpa_printf(MSG_DEBUG, "No WPA/RSN IE from STA");
-                       return -1;
+                       reason = WLAN_REASON_INVALID_IE;
+                       goto fail;
                 }
  #ifdef CONFIG_WPS