]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HS 2.0: Add HS 2.0 Indication element into (Re)Association Request
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 3 Oct 2011 15:10:23 +0000 (18:10 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 8 May 2012 20:30:04 +0000 (23:30 +0300)
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/sme.c
wpa_supplicant/wpa_supplicant.c

index cf5e08df23f945534f3c50ddd95c78634b4c6791..1586a5af5a09bd4ec08b80b3b371dec7247458e3 100644 (file)
@@ -26,6 +26,7 @@
 #include "bss.h"
 #include "scan.h"
 #include "sme.h"
+#include "hs20_supplicant.h"
 
 #define SME_AUTH_TIMEOUT 5
 #define SME_ASSOC_TIMEOUT 5
@@ -222,6 +223,21 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
        }
 #endif /* CONFIG_P2P */
 
+#ifdef CONFIG_HS20
+       if (wpa_s->conf->hs20) {
+               struct wpabuf *hs20;
+               hs20 = wpabuf_alloc(20);
+               if (hs20) {
+                       wpas_hs20_add_indication(hs20);
+                       os_memcpy(wpa_s->sme.assoc_req_ie +
+                                 wpa_s->sme.assoc_req_ie_len,
+                                 wpabuf_head(hs20), wpabuf_len(hs20));
+                       wpa_s->sme.assoc_req_ie_len += wpabuf_len(hs20);
+                       wpabuf_free(hs20);
+               }
+       }
+#endif /* CONFIG_HS20 */
+
 #ifdef CONFIG_INTERWORKING
        if (wpa_s->conf->interworking) {
                u8 *pos = wpa_s->sme.assoc_req_ie;
index 5633a2c09241b99f432e32e45106662e0dfe0d31..0996c382042addcf32c1ca27de9cfc1c75a1c8a4 100644 (file)
@@ -45,6 +45,7 @@
 #include "bss.h"
 #include "scan.h"
 #include "offchannel.h"
+#include "hs20_supplicant.h"
 
 const char *wpa_supplicant_version =
 "wpa_supplicant v" VERSION_STR "\n"
@@ -1275,6 +1276,20 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
        }
 #endif /* CONFIG_P2P */
 
+#ifdef CONFIG_HS20
+       if (wpa_s->conf->hs20) {
+               struct wpabuf *hs20;
+               hs20 = wpabuf_alloc(20);
+               if (hs20) {
+                       wpas_hs20_add_indication(hs20);
+                       os_memcpy(wpa_ie + wpa_ie_len, wpabuf_head(hs20),
+                                 wpabuf_len(hs20));
+                       wpa_ie_len += wpabuf_len(hs20);
+                       wpabuf_free(hs20);
+               }
+       }
+#endif /* CONFIG_HS20 */
+
 #ifdef CONFIG_INTERWORKING
        if (wpa_s->conf->interworking) {
                u8 *pos = wpa_ie;