]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add PMKSA_FLUSH ctrl_iface command
authorAhmad Kholaif <akholaif@qca.qualcomm.com>
Fri, 26 Sep 2014 17:20:21 +0000 (10:20 -0700)
committerJouni Malinen <j@w1.fi>
Sat, 27 Sep 2014 07:44:22 +0000 (10:44 +0300)
"PMKSA_FLUSH" can now be used to flush PMKSA cache entries over the
control interface.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/ctrl_iface.c
wpa_supplicant/wpa_cli.c

index 9d28837b160d33b7c54d7bff626f34f092e90e4c..c2b75f31cffea974bcb7fcbe858339ebc3bc2f2d 100644 (file)
@@ -6507,6 +6507,8 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
        } else if (os_strcmp(buf, "PMKSA") == 0) {
                reply_len = wpa_sm_pmksa_cache_list(wpa_s->wpa, reply,
                                                    reply_size);
+       } else if (os_strcmp(buf, "PMKSA_FLUSH") == 0) {
+               wpa_sm_pmksa_cache_flush(wpa_s->wpa, NULL);
        } else if (os_strncmp(buf, "SET ", 4) == 0) {
                if (wpa_supplicant_ctrl_iface_set(wpa_s, buf + 4))
                        reply_len = -1;
index d65bff62f48bae79483117c17b90d5327ce999b8..18b9b772040a58161cae8ca1c8a4bcc9903c568c 100644 (file)
@@ -532,6 +532,13 @@ static int wpa_cli_cmd_pmksa(struct wpa_ctrl *ctrl, int argc, char *argv[])
 }
 
 
+static int wpa_cli_cmd_pmksa_flush(struct wpa_ctrl *ctrl, int argc,
+                                  char *argv[])
+{
+       return wpa_ctrl_command(ctrl, "PMKSA_FLUSH");
+}
+
+
 static int wpa_cli_cmd_help(struct wpa_ctrl *ctrl, int argc, char *argv[])
 {
        print_help(argc > 0 ? argv[0] : NULL);
@@ -2519,6 +2526,9 @@ static struct wpa_cli_cmd wpa_cli_commands[] = {
        { "pmksa", wpa_cli_cmd_pmksa, NULL,
          cli_cmd_flag_none,
          "= show PMKSA cache" },
+       { "pmksa_flush", wpa_cli_cmd_pmksa_flush, NULL,
+         cli_cmd_flag_none,
+         "= flush PMKSA cache entries" },
        { "reassociate", wpa_cli_cmd_reassociate, NULL,
          cli_cmd_flag_none,
          "= force reassociation" },