[ip6] use 'Get<Filter>()' (remove unnecessary namespace) (#5605)

This commit also fixes warning error with unused returned `otError`
value when calling `RemoveUnsecurePort()`.
This commit is contained in:
Abtin Keshavarzian
2020-10-04 16:28:33 -07:00
committed by GitHub
parent 1f40793255
commit e0bc277ccb
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -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<ot::Ip6::Filter>().IsUnsecurePort(dstPort))
if (aMessage.IsLinkSecurityEnabled() && Get<Filter>().IsUnsecurePort(dstPort))
{
Get<ot::Ip6::Filter>().RemoveUnsecurePort(dstPort);
IgnoreError(Get<Filter>().RemoveUnsecurePort(dstPort));
}
}
#endif
@@ -1233,7 +1234,8 @@ start:
SuccessOrExit(error = aMessage.Read(aMessage.GetOffset(), sourcePort));
sourcePort = HostSwap16(sourcePort);
if (Get<ot::Ip6::Filter>().IsUnsecurePort(sourcePort))
if (Get<Filter>().IsUnsecurePort(sourcePort))
{
aMessage.SetLinkSecurityEnabled(false);
otLogInfoIp6("Disabled link security for packet to %s", header.GetDestination().ToString().AsCString());
+1 -1
View File
@@ -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));
}