From e9f8a5898bc5fdee2523ee191bf3802b54b09bbd Mon Sep 17 00:00:00 2001 From: kangping Date: Sun, 11 Apr 2021 18:46:29 +0800 Subject: [PATCH] [UDP-Proxy] track Mesh-Local prefix in UdpProxyClient --- src/library/commissioner_impl.cpp | 6 +++--- src/library/udp_proxy.cpp | 4 ++-- tests/integration/common.sh | 4 ++++ .../integration/mini_commissioner/test_mini_commissioner.sh | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/library/commissioner_impl.cpp b/src/library/commissioner_impl.cpp index 6ee369d93..8f1ccc7a3 100644 --- a/src/library/commissioner_impl.cpp +++ b/src/library/commissioner_impl.cpp @@ -478,9 +478,9 @@ void CommissionerImpl::GetRawActiveDataset(Handler aHandler, uint16_t } #endif - // Send MGMT_ACTIVE_GET.req to the Border Agent but not the Leader, - // because we don't possess the Mesh-Local Prefix before getting the - // Active Operational Dataset. + // Always request Active Dataset from the Border Agent because + // the Mesh-Local prefix of current network is agnostic before + // we requesting the latest Active Operational Dataset. mBrClient.SendRequest(request, onResponse); LOG_DEBUG(LOG_REGION_MGMT, "sent MGMT_ACTIVE_GET.req"); diff --git a/src/library/udp_proxy.cpp b/src/library/udp_proxy.cpp index 87d896fe1..c115e5556 100644 --- a/src/library/udp_proxy.cpp +++ b/src/library/udp_proxy.cpp @@ -187,10 +187,10 @@ Error ProxyClient::SetMeshLocalPrefix(const ByteArray &aMeshLocalPrefix) Error error; VerifyOrExit(aMeshLocalPrefix.size() == kMeshLocalPrefixLength, - error = ERROR_INVALID_ARGS("Thread Mesh-Local Prefix length must be {}", kMeshLocalPrefixLength)); + error = ERROR_INVALID_ARGS("Thread Mesh-local Prefix length must be {}", kMeshLocalPrefixLength)); VerifyOrExit( std::equal(aMeshLocalPrefix.begin(), aMeshLocalPrefix.begin() + sizeof(meshLocalPrefix), meshLocalPrefix), - error = ERROR_INVALID_ARGS("Thread Mesh-Local Prefix must start with fd00::/8")); + error = ERROR_INVALID_ARGS("Thread mesh-local Prefix must starts with fd00::/8")); mMeshLocalPrefix = aMeshLocalPrefix; diff --git a/tests/integration/common.sh b/tests/integration/common.sh index a9a398d03..c884724ad 100755 --- a/tests/integration/common.sh +++ b/tests/integration/common.sh @@ -262,3 +262,7 @@ start_mini_commissioner() { pgrep -f "${MINI_COMMISSIONER}" } + +stop_mini_commissioner() { + sudo kill -9 "$(pgrep -f "${MINI_COMMISSIONER}")" +} diff --git a/tests/integration/mini_commissioner/test_mini_commissioner.sh b/tests/integration/mini_commissioner/test_mini_commissioner.sh index ed79de5f2..af360a177 100755 --- a/tests/integration/mini_commissioner/test_mini_commissioner.sh +++ b/tests/integration/mini_commissioner/test_mini_commissioner.sh @@ -44,7 +44,7 @@ test_mini_commissioner() { start_mini_commissioner start_joiner "meshcop" - stop_commissioner + stop_mini_commissioner stop_daemon }