mirror of
https://github.com/espressif/openthread.git
synced 2026-08-19 17:09:51 +00:00
[joiner] keep discovering when UDP port is bad (#11337)
This commit fixes the issue that the joiner starts joining process immediately when an invalid Joiner UDP Port is encountered. This issue was introduced by #9445 which attempts to ignore joiner routers having an invalid Joiner UDP Port.
This commit is contained in:
@@ -249,7 +249,7 @@ void Joiner::HandleDiscoverResult(Mle::DiscoverScanner::ScanResult *aResult)
|
||||
{
|
||||
VerifyOrExit(mState == kStateDiscover);
|
||||
|
||||
if (aResult != nullptr && aResult->mJoinerUdpPort > 0)
|
||||
if (aResult != nullptr)
|
||||
{
|
||||
SaveDiscoveredJoinerRouter(*aResult);
|
||||
}
|
||||
@@ -270,9 +270,11 @@ void Joiner::SaveDiscoveredJoinerRouter(const Mle::DiscoverScanner::ScanResult &
|
||||
{
|
||||
uint8_t priority;
|
||||
bool doesAllowAny;
|
||||
JoinerRouter *end = GetArrayEnd(mJoinerRouters);
|
||||
JoinerRouter *end;
|
||||
JoinerRouter *entry;
|
||||
|
||||
VerifyOrExit(aResult.mJoinerUdpPort > 0);
|
||||
|
||||
doesAllowAny = AsCoreType(&aResult.mSteeringData).PermitsAllJoiners();
|
||||
|
||||
LogInfo("Joiner discover network: %s, pan:0x%04x, port:%d, chan:%d, rssi:%d, allow-any:%s",
|
||||
@@ -284,6 +286,8 @@ void Joiner::SaveDiscoveredJoinerRouter(const Mle::DiscoverScanner::ScanResult &
|
||||
// We keep the list sorted based on priority. Find the place to
|
||||
// add the new result.
|
||||
|
||||
end = GetArrayEnd(mJoinerRouters);
|
||||
|
||||
for (entry = &mJoinerRouters[0]; entry < end; entry++)
|
||||
{
|
||||
if (priority > entry->mPriority)
|
||||
|
||||
Reference in New Issue
Block a user