Changeset c0dba7a


Ignore:
Timestamp:
04/02/08 16:26:47 (13 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:
007fb43
Parents:
590fb30
Message:
  • Fixed compile error on systems where bh_tstamp in the bpf header is a bpf_timeval rather than a timeval, e.g. OpenBSD ( Reported by Niclas Rosell )
  • Updated all formats that require it to use the new "Do not own the buffer" prepare_packet flag
Location:
lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • lib/format_bpf.c

    rf0fb38f rc0dba7a  
    353353                                FORMATIN(libtrace)->buffer;
    354354        }
    355 
     355        flags |= TRACE_PREP_DO_NOT_OWN_BUFFER;
    356356        /* Read one packet out */
    357357       
     
    388388{
    389389        struct timeval tv;
    390         tv=BPFHDR(packet)->bh_tstamp;
     390        /* OpenBSD uses a bpf_timeval rather than a timeval so we must copy
     391         * each timeval element individually rather than doing a structure
     392         * assignment */
     393        tv.tv_sec = BPFHDR(packet)->bh_tstamp.tv_sec;
     394        tv.tv_usec = BPFHDR(packet)->bh_tstamp.tv_usec;
     395
    391396        return tv;
    392397}
  • lib/format_dag24.c

    rf52bcdd rc0dba7a  
    325325        }
    326326
     327        flags |= TRACE_PREP_DO_NOT_OWN_BUFFER;
     328       
    327329        if (packet->buf_control == TRACE_CTRL_PACKET) {
    328330                packet->buf_control = TRACE_CTRL_EXTERNAL;
  • lib/format_dag25.c

    rf52bcdd rc0dba7a  
    473473        }
    474474
     475        flags |= TRACE_PREP_DO_NOT_OWN_BUFFER;
     476       
    475477        if (packet->buf_control == TRACE_CTRL_PACKET) {
    476478                free(packet->buffer);
  • lib/format_rt.c

    rf0fb38f rc0dba7a  
    496496                libtrace_packet_t *packet, int blocking) {
    497497        uint32_t prep_flags = 0;
    498        
     498
     499        prep_flags |= TRACE_PREP_DO_NOT_OWN_BUFFER;
     500
    499501        if (rt_read(libtrace, &packet->buffer, (size_t)RT_INFO->rt_hdr.length,
    500502                                blocking) != RT_INFO->rt_hdr.length) {
Note: See TracChangeset for help on using the changeset viewer.