Changeset e1f3b6b


Ignore:
Timestamp:
11/30/12 16:40:23 (8 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:
244426f
Parents:
f00c146
Message:
  • Fix byte ordering issue when determining the BPF RT type
  • Make sure we actually do something if rt_to_pcap_dlt is called with an invalid RT type - also fixed the warning here about not returning at the end of the function
Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/format_bpf.c

    rf00c146 re1f3b6b  
    384384        uint32_t flags = 0;
    385385
    386         packet->type = bpf_linktype_to_rt(ntohs(FORMATIN(libtrace)->linktype));
     386        packet->type = bpf_linktype_to_rt(FORMATIN(libtrace)->linktype);
    387387       
    388388        /* Read from the BPF interface into our capture buffer */
  • lib/linktypes.c

    rf00c146 re1f3b6b  
    154154       
    155155        fprintf(stderr, "Error: RT type %u cannot be converted to a pcap DLT\n", rt_type);
    156 
     156        assert(rt_type >= TRACE_RT_DATA_DLT && rt_type < TRACE_RT_DATA_BPF_END);
     157        return 0;       /* satisfy warnings */
    157158}
    158159
Note: See TracChangeset for help on using the changeset viewer.