From d19897289d2e4c042431bacd15365b4c754a5459 Mon Sep 17 00:00:00 2001 From: krypton36 Date: Fri, 8 Jul 2022 11:49:01 -0700 Subject: [PATCH 1/5] Resolve darwin-framework-tool compilation issue on mainline (#20510) --- .../darwin-framework-tool/zap-generated/test/Commands.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 34ab4da3903ef8..299ebf69ea0910 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -89307,8 +89307,8 @@ class TestUserLabelClusterConstraints : public TestCommandBridge { CHIP_ERROR TestAttemptToWriteOverlyLongItemForLabel_1() { - MTRDevice * device = GetDevice("alpha"); - MTRTestUserLabel * cluster = [[MTRTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterUserLabel * cluster = [[MTRBaseClusterUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id labelListArgument; @@ -89333,8 +89333,8 @@ class TestUserLabelClusterConstraints : public TestCommandBridge { CHIP_ERROR TestAttemptToWriteOverlyLongItemForValue_2() { - MTRDevice * device = GetDevice("alpha"); - MTRTestUserLabel * cluster = [[MTRTestUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterUserLabel * cluster = [[MTRBaseClusterUserLabel alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id labelListArgument; From 3d8f2cee8511658308c525add42817136a260e2d Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Fri, 8 Jul 2022 11:50:52 -0700 Subject: [PATCH 2/5] Update cherry-picks.yaml --- .github/workflows/cherry-picks.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cherry-picks.yaml b/.github/workflows/cherry-picks.yaml index 64a5341fa973f6..255ab1397c5080 100644 --- a/.github/workflows/cherry-picks.yaml +++ b/.github/workflows/cherry-picks.yaml @@ -36,6 +36,8 @@ jobs: with: token: ${{ secrets.MATTER_PAT }} branch: sve + labels: | + sve cherry pick reviewers: | woody-apple andy31415 From d23106cbd84f0aa161f3c1847346acf46eccf24b Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Fri, 8 Jul 2022 11:54:24 -0700 Subject: [PATCH 3/5] Update labeler.yml --- .github/labeler.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index e3106f8ab57d01..eb4596ae14251c 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -51,9 +51,6 @@ gn: - "*.gn" - "*.gni" -tests: - - src/app/tests/* - github: - .github @@ -66,6 +63,11 @@ tools: ############################################################ # Tests ############################################################ +tests: + - src/app/tests/* + - src/app/tests/suites/* + - src/app/tests/suites/certification/* + test driver: - src/test_driver/* From b7a77885e67288dcc817181b0dd461a7d6d908c1 Mon Sep 17 00:00:00 2001 From: Jerry Johns Date: Fri, 8 Jul 2022 15:11:24 -0700 Subject: [PATCH 4/5] Fix setting port to 0 in Server (#20489) When setting ServerInitParams::operationalServicePort to 0 before calling Server::Init(), commissioning would fail due to a failure to discover the commissionee. This was because DNS-SD was advertising port 0 instead of the actual bound port. --- src/app/server/Server.cpp | 9 ++++++++- src/app/server/Server.h | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index b9994f54ff7227..4330446f410698 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -252,7 +252,14 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) SuccessOrExit(err); #endif - app::DnssdServer::Instance().SetSecuredPort(mOperationalServicePort); + // + // We need to advertise the port that we're listening to for unsolicited messages over UDP. However, we have both a IPv4 + // and IPv6 endpoint to pick from. Given that the listen port passed in may be set to 0 (which then has the kernel select + // a valid port at bind time), that will result in two possible ports being provided back from the resultant endpoint + // initializations. Since IPv6 is POR for Matter, let's go ahead and pick that port. + // + app::DnssdServer::Instance().SetSecuredPort(mTransports.GetTransport().GetImplAtIndex<0>().GetBoundPort()); + app::DnssdServer::Instance().SetUnsecuredPort(mUserDirectedCommissioningPort); app::DnssdServer::Instance().SetInterfaceId(mInterfaceId); diff --git a/src/app/server/Server.h b/src/app/server/Server.h index 7045dcad598381..9ef21431d9772b 100644 --- a/src/app/server/Server.h +++ b/src/app/server/Server.h @@ -66,6 +66,10 @@ namespace chip { constexpr size_t kMaxBlePendingPackets = 1; +// +// NOTE: Please do not alter the order of template specialization here as the logic +// in the Server impl depends on this. +// using ServerTransportMgr = chip::TransportMgr Date: Fri, 8 Jul 2022 15:11:38 -0700 Subject: [PATCH 5/5] Fix SessionManager::Shutdown to actually shut-down sessions (#20487) SessionManager::Shutdown() wasn't actually shutting down any sessions that were resident in the session table. This meant that they would only get torn down on program termination, which causes issues in the Python REPL since it results in Log prints being emitted well after we've actually disconnected the logging subsystem. --- src/transport/SessionManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index 3a7bd44a3ce38f..bd84ab651ba84d 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -111,6 +111,12 @@ void SessionManager::Shutdown() mFabricTable->RemoveFabricDelegate(this); mFabricTable = nullptr; } + + mSecureSessions.ForEachSession([&](auto session) { + session->MarkForEviction(); + return Loop::Continue; + }); + mMessageCounterManager = nullptr; mState = State::kNotReady;