[PATCH] wpa_supplicant: Store absolute path to P2P config file

Andrei Otcheretianski andrei.otcheretianski at intel.com
Tue May 12 23:59:02 PDT 2026


When wpa_supplicant is daemonized, relative paths are not valid anymore.
If the P2P device is toggled (disabled/enabled) when wpa_supplicant runs
with -B option, the configuration isn't found and P2P device interface
can't be re-added.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 wpa_supplicant/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/main.c b/wpa_supplicant/main.c
index ec8a90bc09..eeb3606ade 100644
--- a/wpa_supplicant/main.c
+++ b/wpa_supplicant/main.c
@@ -275,7 +275,8 @@ int main(int argc, char *argv[])
 			goto out;
 #ifdef CONFIG_P2P
 		case 'm':
-			params.conf_p2p_dev = optarg;
+			os_free(params.conf_p2p_dev);
+			params.conf_p2p_dev = os_rel2abs_path(optarg);
 			break;
 #endif /* CONFIG_P2P */
 		case 'o':
@@ -432,6 +433,9 @@ out:
 	os_free(params.match_ifaces);
 #endif /* CONFIG_MATCH_IFACE */
 	os_free(params.pid_file);
+#ifdef CONFIG_P2P
+	os_free(params.conf_p2p_dev);
+#endif /* CONFIG_P2P */
 
 	crypto_unload();
 	os_program_deinit();
-- 
2.53.0




More information about the Hostap mailing list