[netif] do not allow external link-local unicast addresses (#2579)

Thread does not support address resolution for link-local unicast addresses.
As a result, any link-local unicast address other than the one based on the
IEEE 802.15.4 Extended Address is not useful.
This commit is contained in:
Jonathan Hui
2018-02-27 02:53:52 +00:00
committed by GitHub
parent 34b045c96b
commit b6763163ab
+2
View File
@@ -410,6 +410,8 @@ otError Netif::AddExternalUnicastAddress(const NetifUnicastAddress &aAddress)
NetifUnicastAddress *entry;
size_t num = sizeof(mExtUnicastAddresses) / sizeof(mExtUnicastAddresses[0]);
VerifyOrExit(!aAddress.GetAddress().IsLinkLocal(), error = OT_ERROR_INVALID_ARGS);
for (entry = mUnicastAddresses; entry; entry = entry->GetNext())
{
if (entry->GetAddress() == aAddress.GetAddress())