Skip to content

Commit

Permalink
[Thread] make mesh-local addresses non-preferred (#6363)
Browse files Browse the repository at this point in the history
This commit maps Thread mesh-local addresses as non-preferred addresses
in lwIP so that they will not be selected as source address.
  • Loading branch information
bukepo authored and pull[bot] committed Jul 30, 2021
1 parent d747fbf commit 2001536
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,11 @@ void GenericThreadStackManagerImpl_OpenThread_LwIP<ImplClass>::UpdateThreadInter
}
}

// Set the address state to PREFERRED or ACTIVE depending on the state in OpenThread.
netif_ip6_addr_set_state(mNetIf, addrIdx, (otAddr->mPreferred) ? IP6_ADDR_PREFERRED : IP6_ADDR_VALID);
// Set non-mesh-local address state to PREFERRED or ACTIVE depending on the state in OpenThread.
netif_ip6_addr_set_state(mNetIf, addrIdx,
(otAddr->mPreferred && !IsOpenThreadMeshLocalAddress(Impl()->OTInstance(), addr))
? IP6_ADDR_PREFERRED
: IP6_ADDR_VALID);

// Record that the netif address slot was assigned during this loop.
addrAssigned[addrIdx] = true;
Expand Down

0 comments on commit 2001536

Please sign in to comment.