diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index 62a3888cb..3d6cf9c14 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -237,16 +237,7 @@ otError Mle::Start(bool aAnnounceAttach) if (Get().GetPanId() == Mac::kPanIdBroadcast) { - // if PAN ID is not configured, pick a random one to start - - uint16_t panid; - - do - { - panid = Random::NonCrypto::GetUint16(); - } while (panid == Mac::kPanIdBroadcast); - - Get().SetPanId(panid); + Get().SetPanId(Mac::GenerateRandomPanId()); } SetStateDetached();