Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#421 fix ms to ns conversion #460

Merged
merged 1 commit into from
Jan 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Unable to build with libpcap 1.8.1 (#430)
- tcpprep -S not working for large cache files (#423)
- Unable to tcprewrite range of ports with --portmap (#422)
- --maxsleep broken for values less than 1000 (#421)
- Avoid non-blocking behaviour when using STDIN (#416)
- pcap containing >1020 packets produces invalid cache file (#415)
- heap-buffer-overflow in get_l2protocol (#410)
Expand Down
2 changes: 1 addition & 1 deletion src/send_packets.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ static bool calc_sleep_time(tcpreplay_t *ctx, struct timeval *pkt_time_delta,
dbgx(3, "original packet delta pkt_time: " TIMEVAL_FORMAT, nap_for.tv_sec, nap_for.tv_usec);

TIMEVAL_TO_TIMESPEC(&nap_for, &ctx->nap);
dbgx(3, "original packet delta timv: " TIMESPEC_FORMAT, ctx->nap.tv_sec, ctx->nap.tv_nsec);
dbgx(3, "original packet delta time: " TIMESPEC_FORMAT, ctx->nap.tv_sec, ctx->nap.tv_nsec);
timesdiv_float(&ctx->nap, options->speed.multiplier);
dbgx(3, "original packet delta/div: " TIMESPEC_FORMAT, ctx->nap.tv_sec, ctx->nap.tv_nsec);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/tcpreplay_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ tcpreplay_post_args(tcpreplay_t *ctx, int argc)

if (HAVE_OPT(MAXSLEEP)) {
options->maxsleep.tv_sec = OPT_VALUE_MAXSLEEP / 1000;
options->maxsleep.tv_nsec = (OPT_VALUE_MAXSLEEP % 1000) * 1000;
options->maxsleep.tv_nsec = (OPT_VALUE_MAXSLEEP % 1000) * 1000 * 1000;
}

#ifdef ENABLE_VERBOSE
Expand Down