diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index d9ab8de48e1133..07dece0685872f 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -1057,9 +1057,9 @@ Optional SessionManager::FindSecureSessionForNode(ScopedNodeId pe (!type.HasValue() || type.Value() == session->GetSecureSessionType())) { // - // Select the active session with the most recent activity to return back to the caller. + // Select the active session with the most recent activity of peer to return back to the caller. // - if ((found == nullptr) || (found->GetLastActivityTime() < session->GetLastActivityTime())) + if ((found == nullptr) || (found->GetLastPeerActivityTime() < session->GetLastPeerActivityTime())) { found = session; } diff --git a/src/transport/tests/TestSessionManager.cpp b/src/transport/tests/TestSessionManager.cpp index 12dc46ae360cc6..7c9926f05515eb 100644 --- a/src/transport/tests/TestSessionManager.cpp +++ b/src/transport/tests/TestSessionManager.cpp @@ -1029,19 +1029,19 @@ static void TestFindSecureSessionForNode(nlTestSuite * inSuite, void * inContext CHIP_ERROR err = sessionManager.InjectCaseSessionWithTestKey(aliceToBobSession, 2, 1, aliceNodeId, bobNodeId, aliceFabricIndex, peer, CryptoContext::SessionRole::kInitiator); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - aliceToBobSession->AsSecureSession()->MarkActive(); + aliceToBobSession->AsSecureSession()->MarkActiveRx(); SessionHolder newAliceToBobSession; err = sessionManager.InjectCaseSessionWithTestKey(newAliceToBobSession, 3, 4, aliceNodeId, bobNodeId, aliceFabricIndex, peer, CryptoContext::SessionRole::kInitiator); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - while (System::SystemClock().GetMonotonicTimestamp() <= aliceToBobSession->AsSecureSession()->GetLastActivityTime()) + while (System::SystemClock().GetMonotonicTimestamp() <= aliceToBobSession->AsSecureSession()->GetLastPeerActivityTime()) { // Wait for the clock to advance so the new session is // more-recently-active. } - newAliceToBobSession->AsSecureSession()->MarkActive(); + newAliceToBobSession->AsSecureSession()->MarkActiveRx(); auto foundSession = sessionManager.FindSecureSessionForNode(ScopedNodeId(bobNodeId, aliceFabricIndex), MakeOptional(SecureSession::Type::kCASE));