Changeset 5bb5dd2


Ignore:
Timestamp:
07/07/06 10:19:44 (15 years ago)
Author:
Shane Alcock <salcock@…>
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:
4abd50b
Parents:
f0b9060
Message:

Fixed wag_get_capture_length to use the payload length field of the wag header, rather than using the total frame size and subtracting what we assumed to be the header size.
Fixed bug in dag_read_packet where rxerrors would cause the payload to be null but the packet's size would still include the (theoretical) payload size

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    re5c2bc4 r5bb5dd2  
    659659        DAG.diff -= size;
    660660
    661         packet->size = size;
     661        if (packet->payload != NULL)
     662                packet->size = size;
     663        else
     664                packet->size = erf_get_framing_length(packet);
     665       
    662666        tv = trace_get_timeval(packet);
    663667        DUCK.last_pkt = tv.tv_sec;
    664668       
    665         return (size);
     669        return (packet->size);
    666670}
    667671
  • lib/format_wag.c

    r306f91c r5bb5dd2  
    443443
    444444static int wag_get_capture_length(const libtrace_packet_t *packet) {
     445       
     446        struct frame_t * wag_frame_data = (struct frame_t *)packet->header;
     447
     448       
     449        if (wag_frame_data->subtype == FRAME_SUBTYPE_DATA_RX) {
     450                struct frame_data_rx_t *wag_hdr =
     451                        (struct frame_data_rx_t *)packet->header;
     452                return ntohs(wag_hdr->rxinfo.length);
     453        }
     454
     455        if (wag_frame_data->subtype == FRAME_SUBTYPE_DATA_TX) {
     456                struct frame_data_tx_t *wag_hdr =
     457                       (struct frame_data_tx_t *)packet->header;
     458                return ntohs(wag_hdr->txinfo.length);
     459        }
     460       
     461        /* default option - not optimal as there tends to be an
     462         * extra 2 bytes floating around somewhere */
    445463        return ntohs(((struct frame_t *)packet->header)->size)
    446464                -sizeof(struct frame_data_rx_t);
Note: See TracChangeset for help on using the changeset viewer.