Changeset 5a70a80 for lib


Ignore:
Timestamp:
02/15/18 17:59:50 (3 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, etsilive, master, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
Children:
9375d2e
Parents:
a857389
git-author:
Anthony Coddington <anthony.coddington@…> (02/15/18 13:44:38)
git-committer:
Shane Alcock <salcock@…> (02/15/18 17:59:50)
Message:

Silently discard ERF provenance records when writing PCAP.

Doesn't include other formats for now, which tend to only check for TRACE_TYPE_NONDATA. More thought is needed on genericizing these non-data linktype checks vs the IS_LIBTRACE_META_PACKET check in trace_write_packet() which is currently false for provenance records.
Make pcapfile, pcap and pcapint do the same checks.

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcap.c

    r4578626 r5a70a80  
    498498        link = trace_get_packet_buffer(packet,&linktype,&remaining);
    499499
     500        /* Silently discard RT metadata packets and packets with an
     501         * unknown linktype. */
     502        if (linktype == TRACE_TYPE_NONDATA || linktype == TRACE_TYPE_UNKNOWN || linktype == TRACE_TYPE_ERF_META) {
     503                return 0;
     504        }
     505
    500506        /* We may have to convert this packet into a suitable PCAP packet */
    501507
     
    581587{
    582588        int err;
    583 
    584         if (trace_get_link_type(packet) == TRACE_TYPE_NONDATA)
     589        libtrace_linktype_t linktype = trace_get_link_type(packet);
     590
     591        /* Silently discard RT metadata packets and packets with an
     592         * unknown linktype. */
     593        if (linktype == TRACE_TYPE_NONDATA || linktype == TRACE_TYPE_UNKNOWN || linktype == TRACE_TYPE_ERF_META) {
    585594                return 0;
     595        }
    586596
    587597        if (!OUTPUT.trace.pcap) {
  • lib/format_pcapfile.c

    r2c457ec r5a70a80  
    431431        /* Silently discard RT metadata packets and packets with an
    432432         * unknown linktype. */
    433         if (linktype == TRACE_TYPE_NONDATA || linktype == TRACE_TYPE_UNKNOWN) {
     433        if (linktype == TRACE_TYPE_NONDATA || linktype == TRACE_TYPE_UNKNOWN || linktype == TRACE_TYPE_ERF_META) {
    434434                return 0;
    435435        }
Note: See TracChangeset for help on using the changeset viewer.