Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix DeviceProxy selection in AutoCommissioner. (project-chip#22294)
Before project-chip#21256 AutoCommissioner used the operational proxy if it existed at all. This could happen even if it was disconnected, as long as it had been connected at some point in the past. This was accidentally changed to "use the operational proxy only if it's connected" in project-chip#21256. This can lead to a crash, as described in project-chip#22268 (comment), if shutdown happens after the operational proxy is connected but before we get a response to CommissioningComplete. In that case, we will evict our CASE session, which will error out the CommissioningComplete command we sent and try to clean up, but it will select the (now dangling!) mCommissioneeDeviceProxy instead of correctly selecting mOperationalDeviceProxy, because the mOperationalDeviceProxy no longer has a session at that point. The fix is to check for an "initialized" (in the sense that it has a valid peer node id) mOperationalDeviceProxy instead of checking for a connected one. This matches the semantics of the check we used to have before project-chip#21256. Fixes project-chip#22293
- Loading branch information