From d5fa59a640a7de73ad05cdc304b22e2044b62dcc Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 3 Nov 2015 13:35:47 +0300 Subject: [PATCH] system/configure_network.cpp: try to support open wlan, if psk empty --- src/system/configure_network.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/system/configure_network.cpp b/src/system/configure_network.cpp index ee8815d03..5804f1843 100644 --- a/src/system/configure_network.cpp +++ b/src/system/configure_network.cpp @@ -291,10 +291,14 @@ void CNetworkConfig::saveWpaConfig() out << "ctrl_interface=/var/run/wpa_supplicant\n"; out << "network={\n"; out << " ssid=\"" + ssid + "\"\n"; - out << " psk=\"" + key + "\"\n";; - out << " proto=WPA WPA2\n"; - out << " key_mgmt=WPA-PSK\n"; - out << " pairwise=CCMP TKIP\n"; - out << " group=CCMP TKIP\n"; + if (!key.empty()) { + out << " psk=\"" + key + "\"\n";; + out << " proto=WPA WPA2\n"; + out << " key_mgmt=WPA-PSK\n"; + out << " pairwise=CCMP TKIP\n"; + out << " group=CCMP TKIP\n"; + } else { + out << " key_mgmt=NONE\n"; + } out << "}\n"; }