mirror of
https://github.com/espressif/openthread.git
synced 2026-07-30 23:57:47 +00:00
[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:
@@ -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());
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user