From 010b5f9bfc4ccca712e652fc3aad090dddcbfa3f Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Fri, 17 May 2013 11:03:52 +0300 Subject: [PATCH] P2P: Fix p2p_pref_chan setting from configuration file Commit 21d996f775a2131bb0c73d6e18ca9b382f017057 added p2p_pref_chan as a configuration file parameter, but included only the case of dynamically setting this at runtime through the control interface SET command. Complete this functionality by taking this value into use directly from the configuration file, too. Signed-hostap: Jouni Malinen --- wpa_supplicant/p2p_supplicant.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 37aa314d0..090168a78 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3030,6 +3030,12 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s) wpa_printf(MSG_DEBUG, "P2P: Random operating channel: " "%d:%d", p2p.op_reg_class, p2p.op_channel); } + + if (wpa_s->conf->p2p_pref_chan && wpa_s->conf->num_p2p_pref_chan) { + p2p.pref_chan = wpa_s->conf->p2p_pref_chan; + p2p.num_pref_chan = wpa_s->conf->num_p2p_pref_chan; + } + if (wpa_s->conf->country[0] && wpa_s->conf->country[1]) { os_memcpy(p2p.country, wpa_s->conf->country, 2); p2p.country[2] = 0x04;