mirror of
https://github.com/espressif/openthread.git
synced 2026-10-12 02:37:37 +00:00
[address-resolver] change AddSnoopedCacheEntry() to return void (#4941)
This commit is contained in:
@@ -398,14 +398,13 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
otError AddressResolver::AddSnoopedCacheEntry(const Ip6::Address &aEid, Mac::ShortAddress aRloc16)
|
||||
void AddressResolver::AddSnoopedCacheEntry(const Ip6::Address &aEid, Mac::ShortAddress aRloc16)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint16_t numNonEvictable = 0;
|
||||
CacheEntry *entry;
|
||||
|
||||
entry = NewCacheEntry(/* aSnoopedEntry */ true);
|
||||
VerifyOrExit(entry != NULL, error = OT_ERROR_NO_BUFS);
|
||||
VerifyOrExit(entry != NULL, OT_NOOP);
|
||||
|
||||
for (CacheEntry *snooped = mSnoopedList.GetHead(); snooped != NULL; snooped = snooped->GetNext())
|
||||
{
|
||||
@@ -439,7 +438,7 @@ otError AddressResolver::AddSnoopedCacheEntry(const Ip6::Address &aEid, Mac::Sho
|
||||
LogCacheEntryChange(kEntryAdded, kReasonSnoop, *entry);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
return;
|
||||
}
|
||||
|
||||
void AddressResolver::RestartAddressQueries(void)
|
||||
|
||||
@@ -146,11 +146,8 @@ public:
|
||||
* @param[in] aEid A reference to the EID.
|
||||
* @param[in] aRloc16 The RLOC16 corresponding to @p aEid.
|
||||
*
|
||||
* @retval OT_ERROR_NONE Successfully adds the cache entry.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffer space available to add one cache entry.
|
||||
*
|
||||
*/
|
||||
otError AddSnoopedCacheEntry(const Ip6::Address &aEid, Mac::ShortAddress aRloc16);
|
||||
void AddSnoopedCacheEntry(const Ip6::Address &aEid, Mac::ShortAddress aRloc16);
|
||||
|
||||
/**
|
||||
* This method returns the RLOC16 for a given EID, or initiates an Address Query if the mapping is not known.
|
||||
|
||||
@@ -716,7 +716,7 @@ void MeshForwarder::UpdateRoutes(const uint8_t * aFrame,
|
||||
(aMeshDest.GetShort() == Get<Mac::Mac>().GetShortAddress() ||
|
||||
Get<Mle::MleRouter>().IsMinimalChild(aMeshDest.GetShort())))
|
||||
{
|
||||
IgnoreError(Get<AddressResolver>().AddSnoopedCacheEntry(ip6Header.GetSource(), aMeshSource.GetShort()));
|
||||
Get<AddressResolver>().AddSnoopedCacheEntry(ip6Header.GetSource(), aMeshSource.GetShort());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user