Ticket #443: tcpreplay-3.4.4-units.patch

File tcpreplay-3.4.4-units.patch, 1.3 KB (added by aturner, 21 months ago)
  • tcpreplay-3.4.4/src/send_packets.c

    old new  
    436436         * a constant 'rate' (bytes per second). 
    437437         */ 
    438438        if (pkts_sent != 0) { 
    439             n = (float)len / (options.speed.speed * 1024 * 1024 / 8); /* convert Mbps to bps */ 
     439            n = (float)len / (options.speed.speed * 1000 * 1000 / 8); /* convert Mbps to bps */ 
    440440            nap.tv_sec = n; 
    441441            nap.tv_nsec = (n - nap.tv_sec)  * 1000000000; 
    442442 
  • tcpreplay-3.4.4/src/common/utils.c

    old new  
    141141    if (timerisset(&diff)) { 
    142142        if (bytes_sent){ 
    143143            bytes_sec = bytes_sent / frac_sec; 
    144             mb_sec = (bytes_sec * 8) / (1024 * 1024); 
     144            mb_sec = (bytes_sec * 8) / (1000 * 1000); 
    145145        } 
    146146        if (pkts_sent) 
    147147            pkts_sec = pkts_sent / frac_sec; 
    148148    } 
    149149    printf("Actual: " COUNTER_SPEC " packets (" COUNTER_SPEC " bytes) sent in %.02f seconds.", 
    150150            pkts_sent, bytes_sent, frac_sec); 
    151     printf("\t\tRated: %.1f bps, %.2f Mbps, %.2f pps\n", 
     151    printf("\t\tRated: %.1f Bps, %.2f Mbps, %.2f pps\n", 
    152152           bytes_sec, mb_sec, pkts_sec); 
    153153 
    154154    if (failed)