[network-data] fix to ensure resubmit delay (#4644)

Fix bug introduced in 5ebc583 when changing from VerifyOrExit to if.
This commit is contained in:
Rongli Sun
2020-03-06 20:09:18 -08:00
committed by GitHub
parent 9c6df6e541
commit 9e4f9933be
+3 -5
View File
@@ -981,11 +981,9 @@ otError NetworkData::SendServerDataNotification(uint16_t aRloc16)
{
uint32_t diff = TimerMilli::GetNow() - mLastAttempt;
if (((mType == kTypeLocal) && (diff > kDataResubmitDelay)) ||
((mType == kTypeLeader) && (diff > kProxyResubmitDelay)))
{
ExitNow(error = OT_ERROR_ALREADY);
}
VerifyOrExit(((mType == kTypeLocal) && (diff > kDataResubmitDelay)) ||
((mType == kTypeLeader) && (diff > kProxyResubmitDelay)),
error = OT_ERROR_ALREADY);
}
VerifyOrExit((message = Get<Coap::Coap>().NewMessage()) != NULL, error = OT_ERROR_NO_BUFS);