[address-resolver] verify query sent successfully (#2210)

This commit is contained in:
Buke Po
2017-09-21 08:42:53 -07:00
committed by Jonathan Hui
parent 2e7cc0a8c2
commit b9ac11e741
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -273,13 +273,13 @@ otError AddressResolver::Resolve(const Ip6::Address &aEid, uint16_t &aRloc16)
switch (entry->mState)
{
case Cache::kStateInvalid:
SuccessOrExit(error = SendAddressQuery(aEid));
entry->mTarget = aEid;
entry->mRloc16 = Mac::kShortAddrInvalid;
entry->mTimeout = kAddressQueryTimeout;
entry->mFailures = 0;
entry->mRetryTimeout = kAddressQueryInitialRetryDelay;
entry->mState = Cache::kStateQuery;
SendAddressQuery(aEid);
error = OT_ERROR_ADDRESS_QUERY;
break;
@@ -290,8 +290,8 @@ otError AddressResolver::Resolve(const Ip6::Address &aEid, uint16_t &aRloc16)
}
else if (entry->mTimeout == 0 && entry->mRetryTimeout == 0)
{
SuccessOrExit(error = SendAddressQuery(aEid));
entry->mTimeout = kAddressQueryTimeout;
SendAddressQuery(aEid);
error = OT_ERROR_ADDRESS_QUERY;
}
else
+1
View File
@@ -117,6 +117,7 @@ public:
*
* @retval OT_ERROR_NONE Successfully provided the RLOC16.
* @retval OT_ERROR_ADDRESS_QUERY Initiated an Address Query.
* @retval OT_ERROR_NO_BUFS Insufficient buffer space available to send Address Query.
*
*/
otError Resolve(const Ip6::Address &aEid, Mac::ShortAddress &aRloc16);