appneta/tcpreplay

[Bug] Infinite loop in tcprewrite at get.c:569

TimChan2001 opened this issue · 3 comments

Describe the bug
Tcprewrite gets stuck in an infinite loop at the while loop at get.c:569.

To Reproduce
Steps to reproduce the behavior:

  1. export CC=clang && export CFLAGS="-fsanitize=address -g"
  2. ./autogen.sh && ./configure --disable-shared --disable-local-libopts && make clean && make -j8
  3. ./src/tcprewrite -o /dev/null -i POC
    The POC file can be downloaded in POC

Expected behavior
The program continues to run for over a week without termination.
image

System (please complete the following information):

  • OS: Ubuntu
  • OS version: 16.04, 64 bit
  • Tcpreplay Version: 4.4.4

Additional context
After debugging with GDB and adding debug outputs, it seems the program is unable to exit the while loop at get.c:569.

Hi @TimChan2001
I have proposed a small fix for the issue you raised.
I should have tested on the same env you described but got an different error with your pcap first:

Fatal Error: Unable to open input pcap file: unsupported pcap savefile version 60418.4

I had to rewrite it to first and then reproduced the issue.
The fix seems straightforward enough, I expect it will work for you.
BR,

Not merged yet - reopening

fixed in PRs #842 and #859