mirror of
https://github.com/espressif/openthread.git
synced 2026-09-01 14:59:54 +00:00
[ip6] simplify Ip6::HandleDatagram() - remove netif local var (#8035)
This commit updates `Ip6::HandleDatagram()` and removes the local `netif` variable and directly uses `ThreadNetif` instead. Note that the input parameter `aNetif` is either `nullptr` or points to `ThreadNetif`, and in both cases the local variable `netif` will be set to point to `ThreadNetif`.
This commit is contained in:
committed by
Jonathan Hui
parent
2d4896f675
commit
061d22ba8e
@@ -1154,8 +1154,6 @@ start:
|
||||
// determine destination of packet
|
||||
if (header.GetDestination().IsMulticast())
|
||||
{
|
||||
Netif *netif;
|
||||
|
||||
if (aNetif != nullptr)
|
||||
{
|
||||
#if OPENTHREAD_FTD
|
||||
@@ -1165,23 +1163,20 @@ start:
|
||||
forwardThread = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
netif = aNetif;
|
||||
}
|
||||
else
|
||||
{
|
||||
forwardThread = true;
|
||||
|
||||
netif = &Get<ThreadNetif>();
|
||||
}
|
||||
|
||||
forwardHost = header.GetDestination().IsMulticastLargerThanRealmLocal();
|
||||
|
||||
if ((aNetif != nullptr || aMessage.GetMulticastLoop()) && netif->IsMulticastSubscribed(header.GetDestination()))
|
||||
if ((aNetif != nullptr || aMessage.GetMulticastLoop()) &&
|
||||
Get<ThreadNetif>().IsMulticastSubscribed(header.GetDestination()))
|
||||
{
|
||||
receive = true;
|
||||
}
|
||||
else if (netif->IsMulticastPromiscuousEnabled())
|
||||
else if (Get<ThreadNetif>().IsMulticastPromiscuousEnabled())
|
||||
{
|
||||
forwardHost = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user