From e0bc277ccbf7c22ea6dee55144008388c1723ec0 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Sun, 4 Oct 2020 16:28:33 -0700 Subject: [PATCH] [ip6] use 'Get()' (remove unnecessary namespace) (#5605) This commit also fixes warning error with unused returned `otError` value when calling `RemoveUnsecurePort()`. --- src/core/net/ip6.cpp | 8 +++++--- src/core/net/udp6.cpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) 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)); }