diff --git a/src/core/net/ip6.cpp b/src/core/net/ip6.cpp index c21f6361f..72437dfa6 100644 --- a/src/core/net/ip6.cpp +++ b/src/core/net/ip6.cpp @@ -1187,9 +1187,10 @@ start: // TCP/UDP shares header uint16_t srcPort, uint16_t dstPort SuccessOrExit(error = aMessage.Read(aMessage.GetOffset() + sizeof(uint16_t), dstPort)); dstPort = HostSwap16(dstPort); - if (aMessage.IsLinkSecurityEnabled() && Get().IsUnsecurePort(dstPort)) + + if (aMessage.IsLinkSecurityEnabled() && Get().IsUnsecurePort(dstPort)) { - Get().RemoveUnsecurePort(dstPort); + IgnoreError(Get().RemoveUnsecurePort(dstPort)); } } #endif @@ -1233,7 +1234,8 @@ start: SuccessOrExit(error = aMessage.Read(aMessage.GetOffset(), sourcePort)); sourcePort = HostSwap16(sourcePort); - if (Get().IsUnsecurePort(sourcePort)) + + if (Get().IsUnsecurePort(sourcePort)) { aMessage.SetLinkSecurityEnabled(false); otLogInfoIp6("Disabled link security for packet to %s", header.GetDestination().ToString().AsCString()); diff --git a/src/core/net/udp6.cpp b/src/core/net/udp6.cpp index 6f5227c9e..c4b8e18f6 100644 --- a/src/core/net/udp6.cpp +++ b/src/core/net/udp6.cpp @@ -325,7 +325,7 @@ otError Udp::SendTo(SocketHandle &aSocket, Message &aMessage, const MessageInfo #if OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE if (!IsMlePort(aSocket.mSockName.mPort) && - !(aSocket.mSockName.mPort == ot::Tmf::kUdpPort && aMessage.GetSubType() == Message::kSubTypeJoinerEntrust)) + !(aSocket.mSockName.mPort == Tmf::kUdpPort && aMessage.GetSubType() == Message::kSubTypeJoinerEntrust)) { SuccessOrExit(error = otPlatUdpSend(&aSocket, &aMessage, &messageInfoLocal)); }