mirror of
https://github.com/espressif/openthread.git
synced 2026-09-02 23:30:07 +00:00
Remove Netif name and rely on enumerated Interface Id's for netif. (#833)
* Remove Netif name and rely on enumerated Interface Id's for netif.
This commit is contained in:
+2
-24
@@ -58,8 +58,7 @@ Ip6::Ip6(void):
|
||||
mReceiveIp6DatagramCallback(NULL),
|
||||
mReceiveIp6DatagramCallbackContext(NULL),
|
||||
mIsReceiveIp6FilterEnabled(false),
|
||||
mNetifListHead(NULL),
|
||||
mNextInterfaceId(1)
|
||||
mNetifListHead(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -609,7 +608,7 @@ ThreadError Ip6::AddNetif(Netif &aNetif)
|
||||
|
||||
do
|
||||
{
|
||||
if (netif == &aNetif)
|
||||
if (netif == &aNetif || netif->mInterfaceId == aNetif.mInterfaceId)
|
||||
{
|
||||
ExitNow(error = kThreadError_Already);
|
||||
}
|
||||
@@ -621,11 +620,6 @@ ThreadError Ip6::AddNetif(Netif &aNetif)
|
||||
|
||||
aNetif.mNext = NULL;
|
||||
|
||||
if (aNetif.mInterfaceId < 0)
|
||||
{
|
||||
aNetif.mInterfaceId = mNextInterfaceId++;
|
||||
}
|
||||
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
@@ -682,22 +676,6 @@ exit:
|
||||
return netif;
|
||||
}
|
||||
|
||||
Netif *Ip6::GetNetifByName(char *aName)
|
||||
{
|
||||
Netif *netif;
|
||||
|
||||
for (netif = mNetifListHead; netif; netif = netif->mNext)
|
||||
{
|
||||
if (strcmp(netif->GetName(), aName) == 0)
|
||||
{
|
||||
ExitNow();
|
||||
}
|
||||
}
|
||||
|
||||
exit:
|
||||
return netif;
|
||||
}
|
||||
|
||||
bool Ip6::IsUnicastAddress(const Address &aAddress)
|
||||
{
|
||||
bool rval = false;
|
||||
|
||||
Reference in New Issue
Block a user