[PATCH] Make scan_freq field to be saved by save_config

Masashi Honma masashi.honma
Thu Sep 12 03:01:25 PDT 2013


This patch makes scan_freq field to be saved by save_config.

And if set_freq field without any value exists in a network block,

set_freq=

it causes error from nl80211. So I made a check for this error also.

Signed-hostap: Masashi Honma <masashi.honma at gmail.com>

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 6792e04..4d0206e 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4256,7 +4256,7 @@ nl80211_scan_common(struct
wpa_driver_nl80211_data *drv, u8 cmd,
             goto fail;
     }

-    if (params->freqs) {
+    if (params->freqs && params->freqs[0] > 0) {
         struct nlattr *freqs;
         freqs = nla_nest_start(msg, NL80211_ATTR_SCAN_FREQUENCIES);
         if (freqs == NULL)
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index a2791eb..0d2bd8c 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -653,6 +653,7 @@ static void wpa_config_write_network(FILE *f,
struct wpa_ssid *ssid)
     write_auth_alg(f, ssid);
     STR(bgscan);
     STR(autoscan);
+    STR(scan_freq);
 #ifdef IEEE8021X_EAPOL
     write_eap(f, ssid);
     STR(identity);


Regards,
Masashi Honma.



More information about the Hostap mailing list