]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Add option to disable keep-alive frames for testing purposes
authorJouni Malinen <j@w1.fi>
Tue, 18 Dec 2012 14:57:52 +0000 (16:57 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 18 Dec 2012 14:57:52 +0000 (16:57 +0200)
"wpa_cli set no_keep_alive 1/0" can now be used to disable/enable
keep alive frames to enable testing.

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

wpa_supplicant/ctrl_iface.c
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant_i.h

index c5e5fd29580a6f49ab968f6fe23fa2b21b4c65ef..880fe010c6f6b0e456e5923b2c128bb3e8651e24 100644 (file)
@@ -415,6 +415,8 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
                ret = set_bssid_filter(wpa_s, value);
        } else if (os_strcasecmp(cmd, "disallow_aps") == 0) {
                ret = set_disallow_aps(wpa_s, value);
+       } else if (os_strcasecmp(cmd, "no_keep_alive") == 0) {
+               wpa_s->no_keep_alive = !!atoi(value);
        } else {
                value[-1] = '=';
                ret = wpa_config_process_global(wpa_s->conf, cmd, -1);
index d9ed7a243b91930a0bb13252db4415de3da932b3..68b407b9a35a838611ea1cc7af46e1a6817736b4 100644 (file)
@@ -1316,12 +1316,16 @@ 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 to AP " MACSTR,
-                  MAC2STR(wpa_s->bssid));
-       /* TODO: could skip this if normal data traffic has been sent */
-       /* 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);
+       if (!wpa_s->no_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: 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) {
index a92d0c1f4de2b1a3af4548c415aba5ae44dc9298..3a56064b056c05ed92d27f680ea5bf1e24d23c19 100644 (file)
@@ -668,6 +668,8 @@ struct wpa_supplicant {
        struct wpabuf *last_gas_resp;
        u8 last_gas_addr[ETH_ALEN];
        u8 last_gas_dialog_token;
+
+       unsigned int no_keep_alive:1;
 };