Changeset e632f2f


Ignore:
Timestamp:
03/18/08 14:12:36 (14 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:
f0fb38f
Parents:
2faa57e
Message:
  • <format>_set_capture_length now resets the cached capture length for the packet, so that subsequent calls to trace_get_capture_length will no longer return the "old" capture length
  • erf_read_packet should no longer complain about packets with newer ERF types, i.e. ERF type values > 10
Location:
lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    r2faa57e re632f2f  
    386386
    387387        /* Unknown/corrupt */
    388         if (((dag_record_t *)packet->buffer)->type >= 10) {
     388        if (((dag_record_t *)packet->buffer)->type >= TYPE_AAL2) {
    389389                trace_set_err(libtrace, TRACE_ERR_BAD_PACKET, "Corrupt or Unknown ERF type");
    390390                return -1;
     
    609609                return trace_get_capture_length(packet);
    610610        }
     611        /* Reset cached capture length - otherwise we will both return the
     612         * wrong value here and subsequent get_capture_length() calls will
     613         * return the wrong value. */
     614        packet->capture_length = -1;
    611615        erfptr = (dag_record_t *)packet->header;
    612616        erfptr->rlen = htons(size + erf_get_framing_length(packet));
  • lib/format_pcap.c

    rf3f3558 re632f2f  
    559559                return trace_get_capture_length(packet);
    560560        }
     561        /* Reset the cached capture length */
     562        packet->capture_length = -1;
    561563        pcapptr = (struct pcap_pkthdr *)packet->header;
    562564        pcapptr->caplen = size;
  • lib/format_pcapfile.c

    rf3f3558 re632f2f  
    497497                return trace_get_capture_length(packet);
    498498        }
     499        /* Reset the cached capture length */
     500        packet->capture_length = -1;
    499501        pcapptr = (libtrace_pcapfile_pkt_hdr_t *)packet->header;
    500502        pcapptr->caplen = swapl(packet->trace,(uint32_t)size);
Note: See TracChangeset for help on using the changeset viewer.