[address-resolver] change AddSnoopedCacheEntry() to return void (#4941)

This commit is contained in:
Jonathan Hui
2020-05-11 12:44:54 -07:00
parent 29c2d11170
commit 1e5d816838
3 changed files with 5 additions and 9 deletions
+3 -4
View File
@@ -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)
+1 -4
View File
@@ -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.
+1 -1
View File
@@ -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());
}
}
}