aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpas_glue.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-12-06 16:13:29 (GMT)
committerJouni Malinen <j@w1.fi>2014-12-06 16:13:29 (GMT)
commit8105821b394b9ce87a1f5175eaf8399940fad7a9 (patch)
treedadc89395553ffbe64ce95cba39192a1a186dc11 /wpa_supplicant/wpas_glue.c
parent477af8f86924138391be913a21f5024e08c041b1 (diff)
downloadhostap-8105821b394b9ce87a1f5175eaf8399940fad7a9.zip
hostap-8105821b394b9ce87a1f5175eaf8399940fad7a9.tar.gz
hostap-8105821b394b9ce87a1f5175eaf8399940fad7a9.tar.bz2
Replace send_ft_action() driver_op with send_action()
This reduced number of unnecessarily duplicated driver interface callback functions for sending Action frames by using the more generic send_action() instead of FT specific send_ft_action(). Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/wpas_glue.c')
-rw-r--r--wpa_supplicant/wpas_glue.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index 48b854b..172b5f2 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -543,7 +543,44 @@ static int wpa_supplicant_send_ft_action(void *ctx, u8 action,
const u8 *ies, size_t ies_len)
{
struct wpa_supplicant *wpa_s = ctx;
- return wpa_drv_send_ft_action(wpa_s, action, target_ap, ies, ies_len);
+ int ret;
+ u8 *data, *pos;
+ size_t data_len;
+
+ if (action != 1) {
+ wpa_printf(MSG_ERROR, "Unsupported send_ft_action action %d",
+ action);
+ return -1;
+ }
+
+ /*
+ * Action frame payload:
+ * Category[1] = 6 (Fast BSS Transition)
+ * Action[1] = 1 (Fast BSS Transition Request)
+ * STA Address
+ * Target AP Address
+ * FT IEs
+ */
+
+ data_len = 2 + 2 * ETH_ALEN + ies_len;
+ data = os_malloc(data_len);
+ if (data == NULL)
+ return -1;
+ pos = data;
+ *pos++ = 0x06; /* FT Action category */
+ *pos++ = action;
+ os_memcpy(pos, wpa_s->own_addr, ETH_ALEN);
+ pos += ETH_ALEN;
+ os_memcpy(pos, target_ap, ETH_ALEN);
+ pos += ETH_ALEN;
+ os_memcpy(pos, ies, ies_len);
+
+ ret = wpa_drv_send_action(wpa_s, wpa_s->assoc_freq, 0,
+ wpa_s->bssid, wpa_s->own_addr, wpa_s->bssid,
+ data, data_len, 0);
+ os_free(data);
+
+ return ret;
}