Reading from a capture file that has not yet received any packets fails
with "truncated dump file"; to avoid this, flush the file (forcing the
pcap header out) immediately after opening it.
(Added Romain to the credits.)
Reviewed-By: Guy Harris <[email protected]>
Rob Braun <bbraun at synack dot net>
Robert Edmonds <stu-42 at sourceforge dot net>
Roderick Schertler <roderick at argon dot org>
+ Romain Francoise <rfrancoise at debian dot org>
Sagun Shakya <sagun dot shakya at sun dot com>
Sami Farin <safari at iki dot fi>
Scott Rose <syberpunk at users dot sourceforge dot net>
callback = dump_packet;
pcap_userdata = (u_char *)p;
}
+#ifdef HAVE_PCAP_DUMP_FLUSH
+ if (Uflag)
+ pcap_dump_flush(p);
+#endif
} else {
type = pcap_datalink(pd);
printinfo.ndo_type = 1;