Skip to content

Commit

Permalink
Stop trying to commission devices that are not in commissioning mode. (
Browse files Browse the repository at this point in the history
…#13794)

SetUpCodePairer was filtering devices by discriminator, but not
checking for a nonzero CM value, so could end up trying to commission
a device that's not commissionable and miss a device with a colliding
discriminator that is.
  • Loading branch information
bzbarsky-apple authored Jan 21, 2022
1 parent 1d937c0 commit 581ac02
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/controller/SetUpCodePairer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ void SetUpCodePairer::OnDiscoveredDeviceOverBleError(void * appState, CHIP_ERROR

bool SetUpCodePairer::NodeMatchesCurrentFilter(const Dnssd::DiscoveredNodeData & nodeData)
{
if (nodeData.commissioningMode == 0)
{
return false;
}

switch (currentFilter.type)
{
case Dnssd::DiscoveryFilterType::kShortDiscriminator:
Expand Down

0 comments on commit 581ac02

Please sign in to comment.