Skip to content

Commit 334d169

Browse files
committed
Merge pull request appneta#224 from appneta/Enhancement_#223_max_tx_duration_optimizations
appneta#223 add timestamp backoff if TX falls behind, updated help
2 parents a84f188 + dae1e5a commit 334d169

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/send_packets.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ send_packets(tcpreplay_t *ctx, pcap_t *pcap, int idx)
503503
}
504504

505505
/* stop sending based on the duration limit*/
506-
if (end_us > 0) {
506+
if (end_us > 0 && (!do_not_timestamp || !(packetnum % 64))) {
507507
if (gettimeofday(&now, NULL) < 0)
508508
errx(-1, "gettimeofday() failed: %s", strerror(errno));
509509
if (TIMEVAL_TO_MICROSEC(&now) > end_us) {
@@ -522,7 +522,7 @@ send_packets(tcpreplay_t *ctx, pcap_t *pcap, int idx)
522522
#error WTF??? We should not be here!
523523
#endif
524524

525-
dbgx(2, "packet " COUNTER_SPEC " caplen %d", packetnum, pktlen);
525+
dbgx(2, "packet " COUNTER_SPEC " caplen " COUNTER_SPEC, packetnum, pktlen);
526526

527527
/* Dual nic processing */
528528
if (ctx->intf2 != NULL) {
@@ -789,7 +789,7 @@ send_dual_packets(tcpreplay_t *ctx, pcap_t *pcap1, int cache_file_idx1, pcap_t *
789789
#error WTF??? We should not be here!
790790
#endif
791791

792-
dbgx(2, "packet " COUNTER_SPEC " caplen %d", packetnum, pktlen);
792+
dbgx(2, "packet " COUNTER_SPEC " caplen " COUNTER_SPEC, packetnum, pktlen);
793793

794794

795795
#if defined TCPREPLAY && defined TCPREPLAY_EDIT

src/tcpreplay_opts.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ flag = {
362362
max = 1;
363363
arg-default = -1;
364364
arg-range = "1->";
365-
descrip = "Limit the trasmit duration";
365+
descrip = "Limit the number of seconds to send";
366366
doc = <<- EOText
367367
By default, tcpreplay will send all the packets. Alternatively, you can
368368
specify a maximum number of seconds to transmit.

0 commit comments

Comments
 (0)