libweave: Fix wifi bootstrapping We mistakenly go out of bootstrapping mode if any network change is detected (even "transitions" like offline -> offline). We only need to go from bootstrapping mode into monitoring when network connection detects that there is network. BUG=brillo:1233 TEST=`FEATURES=test emerge-link libweave` Change-Id: I7afc715152fc3a2be5a53926c4e3b71c0d22cb79 Reviewed-on: https://chromium-review.googlesource.com/293023 Reviewed-by: Vitaly Buka <vitalybuka@chromium.org> Tested-by: Alex Vakulenko <avakulenko@chromium.org> Commit-Queue: Vitaly Buka <vitalybuka@chromium.org> Tested-by: Vitaly Buka <vitalybuka@chromium.org>
diff --git a/libweave/src/privet/wifi_bootstrap_manager.cc b/libweave/src/privet/wifi_bootstrap_manager.cc index 84ceb3e..bea033f 100644 --- a/libweave/src/privet/wifi_bootstrap_manager.cc +++ b/libweave/src/privet/wifi_bootstrap_manager.cc
@@ -232,7 +232,7 @@ VLOG(3) << "ConnectivityChanged: " << is_connected; UpdateConnectionState(); - if (state_ == State::kBootstrapping) { + if (state_ == State::kBootstrapping && is_connected) { StartMonitoring(); return; }