As we might use cf->lnk_t while a capture is in progress, we need up
update it after each burst of packets. (This is broken - we should have cf->lnk_t be WTAP_ENCAP_PER_PACKET in all capture file formats that can handle more than one packet type, and, in order to support writing out *some* such files in formats that can only handle one packet type, just use the type of the first packet when doing a one-pass operation and gather up all the packet types in a multi-pass operation.) svn path=/trunk/; revision=43048
This commit is contained in:
parent
dbfb305368
commit
0b835b8cb6
10
file.c
10
file.c
|
@ -838,6 +838,10 @@ cf_continue_tail(capture_file *cf, volatile int to_read, int *err)
|
||||||
to_read--;
|
to_read--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Update the file encapsulation; it might have changed based on the
|
||||||
|
packets we've read. */
|
||||||
|
cf->lnk_t = wtap_file_encap(cf->wth);
|
||||||
|
|
||||||
/* Cleanup and release all dfilter resources */
|
/* Cleanup and release all dfilter resources */
|
||||||
if (dfcode != NULL){
|
if (dfcode != NULL){
|
||||||
dfilter_free(dfcode);
|
dfilter_free(dfcode);
|
||||||
|
@ -956,10 +960,8 @@ cf_finish_tail(capture_file *cf, int *err)
|
||||||
* don't need after the sequential run-through of the packets. */
|
* don't need after the sequential run-through of the packets. */
|
||||||
postseq_cleanup_all_protocols();
|
postseq_cleanup_all_protocols();
|
||||||
|
|
||||||
/* Set the file encapsulation type now; we don't know what it is until
|
/* Update the file encapsulation; it might have changed based on the
|
||||||
we've looked at all the packets, as we don't know until then whether
|
packets we've read. */
|
||||||
there's more than one type (and thus whether it's
|
|
||||||
WTAP_ENCAP_PER_PACKET). */
|
|
||||||
cf->lnk_t = wtap_file_encap(cf->wth);
|
cf->lnk_t = wtap_file_encap(cf->wth);
|
||||||
|
|
||||||
if (*err != 0) {
|
if (*err != 0) {
|
||||||
|
|
Loading…
Reference in New Issue