Skip to content

Commit

Permalink
Only do address updates for CASE delivery failures.
Browse files Browse the repository at this point in the history
When the handling of "failed to send message, so update the IP for this peer"
moved out of DeviceCommissioner, we stopped checking whether the session is a
CASE session.  Go back to checking that again.

Fixes #22326
  • Loading branch information
bzbarsky-apple committed Aug 31, 2022
1 parent 08830a5 commit ad09dd8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/OperationalSessionSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ void OperationalSessionSetup::PerformAddressUpdate()
CHIP_ERROR err = LookupPeerAddress();
if (err != CHIP_NO_ERROR)
{
ChipLogError(Controller, "PerformAddressUpdate could not perform lookup");
ChipLogError(Controller, "PerformAddressUpdate could not perform lookup: %" CHIP_ERROR_FORMAT, err.Format());
DequeueConnectionCallbacks(err);
// Do not touch `this` instance anymore; it has been destroyed in DequeueConnectionCallbacks.
return;
Expand Down
3 changes: 2 additions & 1 deletion src/messaging/ReliableMessageMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ CHIP_ERROR ReliableMessageMgr::SendFromRetransTable(RetransTableEntry * entry)
if (exchangeMgr)
{
// After the first failure notify session manager to refresh device data
if (entry->sendCount == 1 && mSessionUpdateDelegate != nullptr)
if (entry->sendCount == 1 && mSessionUpdateDelegate != nullptr && entry->ec->GetSessionHandle()->IsSecureSession() &&
entry->ec->GetSessionHandle()->AsSecureSession()->IsCASESession())
{
mSessionUpdateDelegate->UpdatePeerAddress(entry->ec->GetSessionHandle()->GetPeer());
}
Expand Down

0 comments on commit ad09dd8

Please sign in to comment.