Skip to content

Commit

Permalink
[UDP-Proxy] track Mesh-Local prefix in UdpProxyClient
Browse files Browse the repository at this point in the history
  • Loading branch information
wgtdkp committed Jun 8, 2021
1 parent 09e1a1c commit e9f8a58
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/library/commissioner_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,9 @@ void CommissionerImpl::GetRawActiveDataset(Handler<ByteArray> 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");
Expand Down
4 changes: 2 additions & 2 deletions src/library/udp_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 4 additions & 0 deletions tests/integration/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,7 @@ start_mini_commissioner() {

pgrep -f "${MINI_COMMISSIONER}"
}

stop_mini_commissioner() {
sudo kill -9 "$(pgrep -f "${MINI_COMMISSIONER}")"
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test_mini_commissioner() {
start_mini_commissioner
start_joiner "meshcop"

stop_commissioner
stop_mini_commissioner
stop_daemon
}

Expand Down

0 comments on commit e9f8a58

Please sign in to comment.