shill: Wifi: Pass "frequency" parameter to Ad-Hoc connection
A frequency parameter is required for connecting wpa_supplicant
to IBSS networks.
BUG=chromium-os:23572
TEST=New unit test; Run WiFi autotest network_WiFiMatFunc.011CheckIBSS
Change-Id: Id27ff990c177b0bc6546d77d59e25ca5135969c8
Reviewed-on: https://gerrit.chromium.org/gerrit/27620
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
diff --git a/wifi_service.cc b/wifi_service.cc
index 38c3cb7..d4fe48d 100644
--- a/wifi_service.cc
+++ b/wifi_service.cc
@@ -376,6 +376,14 @@
params[wpa_supplicant::kNetworkPropertyMode].writer().
append_uint32(WiFiEndpoint::ModeStringToUint(mode_));
+ if (mode_ == flimflam::kModeAdhoc && frequency_ != 0) {
+ // Frequency is required in order to successfully conntect to an IBSS
+ // with wpa_supplicant. If we have one from our endpoint, insert it
+ // here.
+ params[wpa_supplicant::kNetworkPropertyFrequency].writer().
+ append_int32(frequency_);
+ }
+
if (Is8021x()) {
// Is EAP key management is not set, set to a default.
if (GetEAPKeyManagement().empty())