rlc_stress_test: fix random PDU dropping

the rand() was sometimes giving NaN so this case needs to be handled
and the PDU not dropped to have real zero drop-rate
master
Andre Puschmann 5 years ago
parent 82f811ed52
commit 48db31c5cf

@ -230,7 +230,8 @@ private:
unique_byte_buffer_t& pdu = *it; unique_byte_buffer_t& pdu = *it;
// Drop // Drop
if (((real_dist(mt19937) > args.pdu_drop_rate) || skip_action) && pdu->N_bytes > 0) { float rnd = real_dist(mt19937);
if (std::isnan(rnd) || (((rnd > args.pdu_drop_rate) || skip_action) && pdu->N_bytes > 0)) {
uint32_t pdu_len = pdu->N_bytes; uint32_t pdu_len = pdu->N_bytes;
// Cut // Cut

Loading…
Cancel
Save