tcpdump mailing list archives

tcpslice when first file not used [PATCH]


From: Paul Herman <herman () cleverbridge com>
Date: Wed, 21 Oct 2009 17:17:20 +0200

Hi tcpdump-workers,

Problem:
When the first file contains no data to be extracted, tcpslice gives an error "error creating output file" even if other data in other source files can be used.

Reason:
in tcpslice.c:extract_slice(), states[0]->p ends up being closed, but then is later used to call pcap_dump_open().

Fix:
I suggest call pcap_dump_open() with the first useable dump file available by moving pcap_dump_open() inside the loop. (patch attached). Tested, works very nicely for me. Hope this helps other people.

Regards,

Paul Herman
www.cleverbridge.com

Attachment: tcpslice.unused_first_file_v2.patch.gz
Description:

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.

Current thread: