Changeset 0210df3


Ignore:
Timestamp:
04/27/06 01:26:33 (15 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:
af1e721
Parents:
4927e86
Message:

Fixed bug where wag packets capture length was set too long when reading from
a trace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_wag.c

    r747c501 r0210df3  
    180180{
    181181        close(INPUT.fd);
    182 
    183182        return 0;
    184183}
     
    322321        size = framesize - sizeof(struct frame_t);
    323322        assert(size < LIBTRACE_PACKET_BUFSIZE);
    324 
     323        assert(size > 0);
    325324       
    326325        if ((numbytes=libtrace_io_read(INPUT.file, buffer2, size)) != size) {
     
    383382
    384383static int wag_get_capture_length(const struct libtrace_packet_t *packet) {
    385         struct frame_data_rx_t *wagptr = (struct frame_data_rx_t *)packet->buffer;
    386         return ntohs(wagptr->hdr.size);
     384        return ntohs(((struct frame_t *)packet->header)->size)
     385                -sizeof(struct frame_data_rx_t);
    387386}
    388387
    389388static int wag_get_wire_length(const struct libtrace_packet_t *packet) {
    390         struct frame_data_rx_t *wagptr = (struct frame_data_rx_t *)packet->buffer;
    391         return ntohs(wagptr->hdr.size);
     389        return ntohs(((struct frame_t *)packet->header)->size)
     390                -sizeof(struct frame_data_rx_t);
    392391}
    393392
Note: See TracChangeset for help on using the changeset viewer.