Changeset 1352066


Ignore:
Timestamp:
10/25/06 15:54:29 (14 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:
67e156c
Parents:
c9f6ee5
Message:

Add support for pcap-misunderstood traces in bpf filters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    rc806cb3 r1352066  
    10061006        if (trace_bpf_compile(filter,packet)==-1)
    10071007                return -1;
     1008
     1009        if (libtrace_to_pcap_dlt(trace_get_link_type(packet))==~0) {
     1010                /* Copy the packet, as we don't want to trash the one we
     1011                 * were passed in
     1012                 */
     1013                packet=trace_copy_packet(packet);
     1014                while (libtrace_to_pcap_dlt(trace_get_link_type(packet))==~0) {
     1015                        if (!demote_packet(packet)) {
     1016                                trace_set_err_out(packet->trace,
     1017                                                TRACE_ERR_NO_CONVERSION,
     1018                                                "pcap does not support this format");
     1019                                return -1;
     1020                        }
     1021                }
     1022        }
    10081023       
    10091024        clen = trace_get_capture_length(packet);
Note: See TracChangeset for help on using the changeset viewer.