mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 11:17:46 +00:00
[coap] fix order of operations in TxParameters::IsValid() (#6027)
To match CalculateInitialRetransmissionTimeout() implementation.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user