I'm trying to emulate the code here: Scapy and tcpreplay: bypass temporary file for performance
When I try running that code, Python errors on this line:
f = subprocess.Popen(argv, stdin=subprocess.PIPE)
The error says
Failed: Error opening pcap file: truncated dump file; tried to read 4 file header bytes, only got 0
I think I'm getting that error because the subprocess is trying to read from stdin before anything is written to stdin.
Any suggestions?