diff --git a/src/core/coap/coap.cpp b/src/core/coap/coap.cpp index 36f4c9d2b..48302ca64 100644 --- a/src/core/coap/coap.cpp +++ b/src/core/coap/coap.cpp @@ -950,8 +950,8 @@ bool TxParameters::IsValid(void) const // Calulate exchange lifetime step by step and verify no overflow. uint32_t tmp = Multiply(mAckTimeout, (1U << (mMaxRetransmit + 1)) - 1); - tmp /= mAckRandomFactorDenominator; tmp = Multiply(tmp, mAckRandomFactorNumerator); + tmp /= mAckRandomFactorDenominator; rval = (tmp != 0 && (tmp + mAckTimeout + 2 * kDefaultMaxLatency) > tmp); }