[joiner] check for non-zero joiner UDP port before electing a joiner router (#9445)

An invalid Discovery Response that carries no Joiner UDP Port TLV will
be accepted by the joiner, but we shouldn't qualify it as a valid
joiner router since we can only open a connection with a non-zero
port.
This commit is contained in:
Suvesh Pratapa
2023-09-28 08:24:12 -07:00
committed by GitHub
parent 50487a647d
commit f19548b4b1
+1 -1
View File
@@ -261,7 +261,7 @@ void Joiner::HandleDiscoverResult(Mle::DiscoverScanner::ScanResult *aResult)
{
VerifyOrExit(mState == kStateDiscover);
if (aResult != nullptr)
if (aResult != nullptr && aResult->mJoinerUdpPort > 0)
{
SaveDiscoveredJoinerRouter(*aResult);
}