mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 03:07:47 +00:00
[mesh-forwarder] avoid unnecessary comparisons on ALOC (#4723)
This commit is contained in:
@@ -391,10 +391,6 @@ otError MeshForwarder::UpdateIp6RouteFtd(Ip6::Header &ip6Header)
|
||||
{
|
||||
mMeshDest = Mle::Mle::Rloc16FromRouterId(mle.GetLeaderId());
|
||||
}
|
||||
else if ((aloc16 >= Mle::kAloc16CommissionerStart) && (aloc16 <= Mle::kAloc16CommissionerEnd))
|
||||
{
|
||||
SuccessOrExit(error = MeshCoP::GetBorderAgentRloc(Get<ThreadNetif>(), mMeshDest));
|
||||
}
|
||||
else if (aloc16 <= Mle::kAloc16DhcpAgentEnd)
|
||||
{
|
||||
uint16_t agentRloc16;
|
||||
@@ -416,11 +412,14 @@ otError MeshForwarder::UpdateIp6RouteFtd(Ip6::Header &ip6Header)
|
||||
mMeshDest = Mle::Mle::Rloc16FromRouterId(routerId);
|
||||
}
|
||||
}
|
||||
else if ((aloc16 >= Mle::kAloc16ServiceStart) && (aloc16 <= Mle::kAloc16ServiceEnd))
|
||||
else if (aloc16 <= Mle::kAloc16ServiceEnd)
|
||||
{
|
||||
SuccessOrExit(error = GetDestinationRlocByServiceAloc(aloc16, mMeshDest));
|
||||
}
|
||||
|
||||
else if (aloc16 <= Mle::kAloc16CommissionerEnd)
|
||||
{
|
||||
SuccessOrExit(error = MeshCoP::GetBorderAgentRloc(Get<ThreadNetif>(), mMeshDest));
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: support for Neighbor Discovery Agent ALOC
|
||||
|
||||
Reference in New Issue
Block a user