shill: wifi: Monitor the presence of WPA supplicant.
Connect to WPA supplicant only if it's present and suspend the device when WPA
supplicant disappears. This ensures that the WiFi device/service state remains
consistent across crashes of WPA supplicant, for example.
Also, drop the device connection when stopping the WiFi device. This avoids a
DCHECK for connections not being present in Manager::DeregisterService.
Remove a device restart on scan failure -- this should be covered now by the
explicit wpa_supplicant monitor.
BUG=chromium-os:31712,chromium-os:25657
TEST=tested on device, kill -SEGV wpa_supplicant; unit tests
Change-Id: I11efb1d841d4c7abd40da725b1d074170baee726
Reviewed-on: https://gerrit.chromium.org/gerrit/26017
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/device.cc b/device.cc
index 2e644af..995aeeb 100644
--- a/device.cc
+++ b/device.cc
@@ -286,6 +286,12 @@
return true;
}
+void Device::DropConnection() {
+ SLOG(Device, 2) << __func__;
+ DestroyIPConfig();
+ SelectService(NULL);
+}
+
void Device::DestroyIPConfig() {
DisableIPv6();
if (ipconfig_.get()) {