P2P: Fix P2P configuration file name
authorGautam <gautams@broadcom.com>
Fri, 31 Jul 2015 09:04:30 +0000 (14:34 +0530)
committerJouni Malinen <j@w1.fi>
Sun, 2 Aug 2015 18:37:09 +0000 (21:37 +0300)
The P2P configuration file is wrongly set as STA configuration file,
even though a separate configuration file is mentioned with '-m' option.
Add initialization and deallocation of global.params->conf_p2p_dev to
fix this.

Signed-off-by: Gautam <gautams@broadcom.com>
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 3b107a1..e1865d5 100644 (file)
@@ -4843,6 +4843,11 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
        if (params->override_ctrl_interface)
                global->params.override_ctrl_interface =
                        os_strdup(params->override_ctrl_interface);
+#ifdef CONFIG_P2P
+       if (params->conf_p2p_dev)
+               global->params.conf_p2p_dev =
+                       os_strdup(params->conf_p2p_dev);
+#endif /* CONFIG_P2P */
        wpa_debug_level = global->params.wpa_debug_level =
                params->wpa_debug_level;
        wpa_debug_show_keys = global->params.wpa_debug_show_keys =
@@ -4984,6 +4989,9 @@ void wpa_supplicant_deinit(struct wpa_global *global)
        os_free(global->params.ctrl_interface_group);
        os_free(global->params.override_driver);
        os_free(global->params.override_ctrl_interface);
+#ifdef CONFIG_P2P
+       os_free(global->params.conf_p2p_dev);
+#endif /* CONFIG_P2P */
 
        os_free(global->p2p_disallow_freq.range);
        os_free(global->p2p_go_avoid_freq.range);
index 0636ee4..a4e99ed 100644 (file)
@@ -225,7 +225,7 @@ struct wpa_params {
         * This can also be %NULL. In such a case, if a P2P Device dedicated
         * interfaces is created, the main configuration file will be used.
         */
-       const char *conf_p2p_dev;
+       char *conf_p2p_dev;
 #endif /* CONFIG_P2P */
 
 };