mirror of
https://github.com/espressif/openthread.git
synced 2026-07-31 08:07:47 +00:00
[network-data] fix bug in external route lookup (#2127)
This commit changes the external route lookup logic to ensure that if an external route prefix is registered by multiple routers (at same priority level) within the thread network, during route/destination lookup on a device which has registered this external route, the router itself is selected/preferred over other routers. This addresses an issue where a message destined for the external address can be passed back and forth between routers.
This commit is contained in:
committed by
Jonathan Hui
parent
df09fc84a4
commit
1b20bc130b
@@ -327,7 +327,9 @@ otError LeaderBase::ExternalRouteLookup(uint8_t aDomainId, const Ip6::Address &a
|
||||
if (rvalRoute == NULL ||
|
||||
entry->GetPreference() > rvalRoute->GetPreference() ||
|
||||
(entry->GetPreference() == rvalRoute->GetPreference() &&
|
||||
netif.GetMle().GetCost(entry->GetRloc()) < netif.GetMle().GetCost(rvalRoute->GetRloc())))
|
||||
(entry->GetRloc() == netif.GetMle().GetRloc16() ||
|
||||
(rvalRoute->GetRloc() != netif.GetMle().GetRloc16() &&
|
||||
netif.GetMle().GetCost(entry->GetRloc()) < netif.GetMle().GetCost(rvalRoute->GetRloc())))))
|
||||
{
|
||||
rvalRoute = entry;
|
||||
rval_plen = static_cast<uint8_t>(plen);
|
||||
|
||||
Reference in New Issue
Block a user