From d5ce8bd450ce85b88215f0a29778d6073f32e294 Mon Sep 17 00:00:00 2001 From: Fred Klassen Date: Sat, 29 Jun 2024 09:15:37 -0700 Subject: [PATCH] Feature #853 -w == --write, -W == --suppress-warnings Also fix maximum snap length --- docs/CHANGELOG | 5 +++-- src/common/sendpacket.c | 2 +- src/tcpreplay_opts.def | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 269df814..c713ef9a 100644 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -1,11 +1,12 @@ -06/23/2024 Version 4.5.0-beta3 +06/29/2024 Version 4.5.0-beta3 - tcpreplay --include / --exclude to control which packets are replayed (#884) - - add -w (--suppress-warnings) option to suppress warning messages (#878) + - add -W (--suppress-warnings) option to suppress warning messages (#878) - AF_XDP compile issue due to merge issue (#876) - memory leak in tcpprep when using include/exclude (#869) - memory leak in tcpprep when using RegEx (#867) - fix nanosecond timestamp regression bug (#863) - autotools - AC_HELP_STRING is obsolete in 2.70 (#856) + - add -w output.pcap command line option to direct the output to a pcap (#853) - configure.ac: do not run conftest in case of cross compilation (#849) - Haiku support (#847) - --fixhdrlen option added to control action on packet length changes (#846) diff --git a/src/common/sendpacket.c b/src/common/sendpacket.c index 4c830891..e1f4518c 100644 --- a/src/common/sendpacket.c +++ b/src/common/sendpacket.c @@ -847,7 +847,7 @@ sendpacket_open_pcap_dump(const char *device, char *errbuf) dbg(1, "sendpacket: using Libpcap"); - pcap = pcap_open_dead(DLT_EN10MB, 65535); + pcap = pcap_open_dead(DLT_EN10MB, MAX_SNAPLEN); if ((dump = pcap_dump_open(pcap, device)) == NULL){ char* err_msg = pcap_geterr(pcap); strlcpy(errbuf, err_msg, PCAP_ERRBUF_SIZE); diff --git a/src/tcpreplay_opts.def b/src/tcpreplay_opts.def index 15731e24..e9184935 100644 --- a/src/tcpreplay_opts.def +++ b/src/tcpreplay_opts.def @@ -265,6 +265,7 @@ flag = { value = i; arg-type = string; max = 1; + equivalence = intf1; must-set; descrip = "Client to server/RX/primary traffic output interface"; doc = <<- EOText @@ -289,8 +290,8 @@ EOText; }; flag = { - name = output; - value = o; + name = write; + value = w; arg-type = string; max = 1; equivalence = intf1; @@ -667,7 +668,6 @@ EOText; flag = { name = pid; - value = P; descrip = "Print the PID of tcpreplay at startup"; flag-code = <<- EOPid @@ -691,7 +691,7 @@ EOText; flag = { name = suppress-warnings; - value = w; + value = W; immediate; descrip = "suppress printing warning messages"; settable;