Changeset d1af45d


Ignore:
Timestamp:
05/13/14 16:25:33 (7 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:
5692bc4
Parents:
dad224b
Message:

Setting the snaplen option will now work for ring:

This feature was missing in the current implementation of ring:

Thanks to Nevil Brownlee for bringing this to our attention.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux.c

    r7a529a9 rd1af45d  
    10201020        struct pollfd pollset; 
    10211021        int ret;
     1022        unsigned int snaplen;
    10221023       
    10231024        ring_release_frame(libtrace, packet);
     
    10481049
    10491050        packet->buffer = header;
     1051
     1052        /* If a snaplen was configured, automatically truncate the packet to
     1053         * the desired length.
     1054         */
     1055        snaplen=LIBTRACE_MIN(
     1056                        (int)LIBTRACE_PACKET_BUFSIZE-(int)sizeof(*header),
     1057                        (int)FORMAT(libtrace->format_data)->snaplen);
     1058       
     1059        TO_TP_HDR(packet->buffer)->tp_snaplen = LIBTRACE_MIN((unsigned int)snaplen, TO_TP_HDR(packet->buffer)->tp_len);
    10501060
    10511061        /* Move to next buffer */
Note: See TracChangeset for help on using the changeset viewer.