mirror of
https://github.com/espressif/openthread.git
synced 2026-08-11 21:27:46 +00:00
[meshcop] add IsBound check in JoinerRouter::HandleStateChanged (#4170)
This commit is contained in:
@@ -76,12 +76,12 @@ void JoinerRouter::HandleStateChanged(otChangedFlags aFlags)
|
||||
VerifyOrExit(Get<Mle::MleRouter>().IsFullThreadDevice());
|
||||
VerifyOrExit(aFlags & OT_CHANGED_THREAD_NETDATA);
|
||||
|
||||
Get<Ip6::Filter>().RemoveUnsecurePort(mSocket.GetSockName().mPort);
|
||||
|
||||
if (Get<NetworkData::Leader>().IsJoiningEnabled())
|
||||
{
|
||||
Ip6::SockAddr sockaddr;
|
||||
|
||||
VerifyOrExit(!mSocket.IsBound());
|
||||
|
||||
sockaddr.mPort = GetJoinerUdpPort();
|
||||
|
||||
mSocket.Open(&JoinerRouter::HandleUdpReceive, this);
|
||||
@@ -91,6 +91,8 @@ void JoinerRouter::HandleStateChanged(otChangedFlags aFlags)
|
||||
}
|
||||
else
|
||||
{
|
||||
Get<Ip6::Filter>().RemoveUnsecurePort(mSocket.GetSockName().mPort);
|
||||
|
||||
mSocket.Close();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user