]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove SAVE_CONFIG redirect from global control interface
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 15 Apr 2014 10:15:09 +0000 (13:15 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 15 Apr 2014 10:26:48 +0000 (13:26 +0300)
The P2P redirection for SAVE_CONFIG issued on the global control
interface was preventing wpas_global_ctrl_iface_save_config() from being
reached. The global version of SAVE_CONFIG was supposed to try to save
configuration files for all interface rather than just the P2P
management interface, so fix this by removing the unneeded and undesired
redirection.

Modify the global SAVE_CONFIG handler to return FAIL if no configuration
files were saved. This makes the behavior match with the per-interface
SAVE_CONFIG.

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

index abffaaebcf55d19ff1e7a837e90d4f3e445307a5..37709805291388d8cf5619b550b4c9896eec3d59 100644 (file)
@@ -6802,7 +6802,6 @@ static char * wpas_global_ctrl_iface_redir_p2p(struct wpa_global *global,
 #ifdef CONFIG_P2P
        static const char * cmd[] = {
                "LIST_NETWORKS",
-               "SAVE_CONFIG",
                "P2P_FIND",
                "P2P_STOP_FIND",
                "P2P_LISTEN",
@@ -6929,7 +6928,7 @@ static int wpas_global_ctrl_iface_set(struct wpa_global *global, char *cmd)
 #ifndef CONFIG_NO_CONFIG_WRITE
 static int wpas_global_ctrl_iface_save_config(struct wpa_global *global)
 {
-       int ret = 0;
+       int ret = 0, saved = 0;
        struct wpa_supplicant *wpa_s;
 
        for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
@@ -6943,9 +6942,16 @@ static int wpas_global_ctrl_iface_save_config(struct wpa_global *global)
                        ret = 1;
                } else {
                        wpa_dbg(wpa_s, MSG_DEBUG, "CTRL_IFACE: SAVE_CONFIG - Configuration updated");
+                       saved++;
                }
        }
 
+       if (!saved && !ret) {
+               wpa_dbg(wpa_s, MSG_DEBUG,
+                       "CTRL_IFACE: SAVE_CONFIG - No configuration files could be updated");
+               ret = 1;
+       }
+
        return ret;
 }
 #endif /* CONFIG_NO_CONFIG_WRITE */