WNM: Send empty IPv4 packet as keep-alive for now
authorJouni Malinen <j@w1.fi>
Mon, 28 May 2012 21:36:23 +0000 (14:36 -0700)
committerJouni Malinen <j@w1.fi>
Mon, 28 May 2012 21:36:23 +0000 (14:36 -0700)
Use an empty IPv4 packet as the keep-alive packet for WNM BSS max idle
period mechanism. This is not really the best possible frame to use for
this, but for now, it can do until a more suitable frame is figured out
for this (e.g., special LLC header to indicate link test purposes).

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/events.c

index 61db038..d09be6c 100644 (file)
@@ -1211,10 +1211,12 @@ static void wnm_bss_keep_alive(void *eloop_ctx, void *sock_ctx)
        if (wpa_s->wpa_state < WPA_ASSOCIATED)
                return;
 
-       wpa_printf(MSG_DEBUG, "WNM: Send keep-alive");
+       wpa_printf(MSG_DEBUG, "WNM: Send keep-alive to AP " MACSTR,
+                  MAC2STR(wpa_s->bssid));
        /* TODO: could skip this if normal data traffic has been sent */
-       /* TODO: send keep alive frame - better use some short unicast data
-        * frame that gets protected if PTK is set */
+       /* TODO: Consider using some more appropriate data frame for this */
+       if (wpa_s->l2)
+               l2_packet_send(wpa_s->l2, wpa_s->bssid, 0x0800, (u8 *) "", 0);
 
 #ifdef CONFIG_SME
        if (wpa_s->sme.bss_max_idle_period) {