[mle] add retransmissions to MLE Link Request on neighbor timeout (#2336)

This commit is contained in:
Jonathan Hui
2017-11-13 04:05:54 -08:00
committed by GitHub
parent 9b0e3b2fba
commit 992263043b
2 changed files with 12 additions and 9 deletions
+1
View File
@@ -64,6 +64,7 @@ enum
kParentResponseMaxDelayRouters = 500, ///< Maximum delay for response for Parent Request sent to routers only
kParentResponseMaxDelayAll = 1000, ///< Maximum delay for response for Parent Request sent to all devices
kUnicastRetransmissionDelay = 1000, ///< Base delay before retransmitting an MLE unicast.
kMaxTransmissionCount = 3, ///< Maximum number of times an MLE message may be transmitted.
kMaxResponseDelay = 1000, ///< Maximum delay before responding to a multicast request
kMaxChildIdRequestTimeout = 5000, ///< Maximum delay for receiving a Child ID Request
kMaxChildUpdateResponseTimeout = 2000, ///< Maximum delay for receiving a Child Update Response
+11 -9
View File
@@ -1935,16 +1935,18 @@ void MleRouter::HandleStateUpdateTimer(void)
#else
if (age >= TimerMilli::SecToMsec(kMaxNeighborAge) &&
age < TimerMilli::SecToMsec(kMaxNeighborAge) + kStateUpdatePeriod)
if (age >= TimerMilli::SecToMsec(kMaxNeighborAge))
{
otLogInfoMle(GetInstance(), "Router timeout expired");
SendLinkRequest(&router);
}
else if (age >= TimerMilli::SecToMsec(kMaxNeighborAge) + kMaxLinkRequestTimeout)
{
RemoveNeighbor(router);
continue;
if (age < TimerMilli::SecToMsec(kMaxNeighborAge) + kMaxTransmissionCount * kUnicastRetransmissionDelay)
{
otLogInfoMle(GetInstance(), "Router timeout expired");
SendLinkRequest(&router);
}
else
{
RemoveNeighbor(router);
continue;
}
}
#endif