diff options
author | Peter Qiu <zqiu@google.com> | 2015-11-16 09:22:34 -0800 |
---|---|---|
committer | Peter Qiu <zqiu@google.com> | 2015-11-16 09:22:34 -0800 |
commit | 31f7086eadd1e9391ef9acf4b3a9174f284112fe (patch) | |
tree | 8ec972fb5d3919779f89b08bfe0d4950c17cd6b1 | |
parent | 58083964e47533d2850340a09884edc22348c5c4 (diff) | |
download | apmanager-31f7086eadd1e9391ef9acf4b3a9174f284112fe.tar.gz |
Release interface after station mode interface setup is completed
This avoids a possible race condition where the interface gets enumerated
by shill before it is setup as station mode, resulting in the interface
being ignored by shill.
Bug: 25704767
TEST=Verify device setup on Edison board
Change-Id: If1ef2840273d84ba39d2796ac9b09a5707b319e7
-rw-r--r-- | service.cc | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -325,13 +325,16 @@ void Service::ReleaseResources() { hostapd_monitor_.reset(); StopHostapdProcess(); dhcp_server_.reset(); - config_->ReleaseDevice(); manager_->ReleaseDHCPPortAccess(config_->selected_interface()); #if defined(__BRILLO__) // Restore station mode interface. string station_mode_interface; manager_->SetupStationModeInterface(&station_mode_interface); #endif // __BRILLO__ + // Only release device after mode switching had completed, to + // make sure the station mode interface gets enumerated by + // shill. + config_->ReleaseDevice(); } void Service::HostapdEventCallback(HostapdMonitor::Event event, |