Apply realm-local scope to mesh-local addresses for source address selection. (#1000)

This commit is contained in:
Jonathan Hui
2016-11-22 08:43:22 -08:00
committed by GitHub
parent 484172cc14
commit b1c19ed091
4 changed files with 27 additions and 9 deletions
+4 -4
View File
@@ -993,18 +993,18 @@ const NetifUnicastAddress *Ip6::SelectSourceAddress(MessageInfo &aMessageInfo)
rvalIface = candidateId;
goto exit;
}
else if (candidateAddr->GetScope() < rvalAddr->GetAddress().GetScope())
else if (addr->GetScope() < rvalAddr->GetScope())
{
// Rule 2: Prefer appropriate scope
if (candidateAddr->GetScope() >= destination->GetScope())
if (addr->GetScope() >= destination->GetScope())
{
rvalAddr = addr;
rvalIface = candidateId;
}
}
else if (candidateAddr->GetScope() > rvalAddr->GetAddress().GetScope())
else if (addr->GetScope() > rvalAddr->GetScope())
{
if (rvalAddr->GetAddress().GetScope() < destination->GetScope())
if (rvalAddr->GetScope() < destination->GetScope())
{
rvalAddr = addr;
rvalIface = candidateId;