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

Bug #729 tcpreplay_edit: disallow both -K and -l options #743

Merged
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
@@ -1,5 +1,6 @@
08/02/2022 Version 4.4.2 Beta 1
- replaying on a loopback interface is broken (#732)
- replay edit with both --loop and --preload_pcap options (#729)
- test suite bus error on armhf (#725)
- format string vulnerability in fix_ipv6_checksums (#723)
- heap-overflow in parse_mpls (#719)
Expand Down
4 changes: 0 additions & 4 deletions src/tcpreplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ main(int argc, char *argv[])
fflush(NULL);

ctx = tcpreplay_init();
#ifdef TCPREPLAY
optct = optionProcess(&tcpreplayOptions, argc, argv);
#elif defined TCPREPLAY_EDIT
optct = optionProcess(&tcpreplay_editOptions, argc, argv);
#endif
argc -= optct;
argv += optct;

Expand Down
10 changes: 10 additions & 0 deletions src/tcpreplay_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@ tcpreplay_post_args(tcpreplay_t *ctx, int argc)
options->preload_pcap = true;
}

#ifdef TCPREPLAY_EDIT
if (HAVE_OPT(PRELOAD_PCAP) && OPT_VALUE_LOOP > 1) {
tcpreplay_seterr(ctx,
"%s",
"tcpreplay_edit --loop (-l) and --preload_pcap (-K) options are mutually exclusive");
ret = -1;
goto out;
}
#endif

/* Dual file mode */
if (HAVE_OPT(DUALFILE)) {
options->dualfile = true;
Expand Down