Browse Source

P2P: Fix P2P configuration file name

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>
Gautam 9 years ago
parent
commit
d4e597959c
2 changed files with 9 additions and 1 deletions
  1. 8 0
      wpa_supplicant/wpa_supplicant.c
  2. 1 1
      wpa_supplicant/wpa_supplicant_i.h

+ 8 - 0
wpa_supplicant/wpa_supplicant.c

@@ -4843,6 +4843,11 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
 	if (params->override_ctrl_interface)
 	if (params->override_ctrl_interface)
 		global->params.override_ctrl_interface =
 		global->params.override_ctrl_interface =
 			os_strdup(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 =
 	wpa_debug_level = global->params.wpa_debug_level =
 		params->wpa_debug_level;
 		params->wpa_debug_level;
 	wpa_debug_show_keys = global->params.wpa_debug_show_keys =
 	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.ctrl_interface_group);
 	os_free(global->params.override_driver);
 	os_free(global->params.override_driver);
 	os_free(global->params.override_ctrl_interface);
 	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_disallow_freq.range);
 	os_free(global->p2p_go_avoid_freq.range);
 	os_free(global->p2p_go_avoid_freq.range);

+ 1 - 1
wpa_supplicant/wpa_supplicant_i.h

@@ -225,7 +225,7 @@ struct wpa_params {
 	 * This can also be %NULL. In such a case, if a P2P Device dedicated
 	 * This can also be %NULL. In such a case, if a P2P Device dedicated
 	 * interfaces is created, the main configuration file will be used.
 	 * interfaces is created, the main configuration file will be used.
 	 */
 	 */
-	const char *conf_p2p_dev;
+	char *conf_p2p_dev;
 #endif /* CONFIG_P2P */
 #endif /* CONFIG_P2P */
 
 
 };
 };