Ignore:
Timestamp:
11/01/06 10:33:29 (14 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
7ca2c7d
Parents:
19c6cbe
Message:

Use DLT_RAW instead of DLT_NULL when writing out raw IP.
Also don't strip the 4 byte FCS off non-ethernet traces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcapfile.c

    rc9f6ee5 r2f3a25e  
    305305        hdr.caplen = trace_get_capture_length(packet);
    306306        /* PCAP doesn't include the FCS, we do */
    307         hdr.wirelen = trace_get_wire_length(packet)-4;
     307        if (trace_get_link_type(packet)==TRACE_TYPE_ETH)
     308                if (trace_get_wire_length(packet) >= 4) {
     309                        hdr.wirelen =
     310                                        trace_get_wire_length(packet)-4;
     311                }
     312                else {
     313                        hdr.wirelen = 0;
     314                }
     315        else
     316                hdr.wirelen = trace_get_wire_length(packet);
     317
    308318
    309319        numbytes=libtrace_io_write(DATAOUT(out)->file,
Note: See TracChangeset for help on using the changeset viewer.