Changeset d8eb866


Ignore:
Timestamp:
03/02/12 17:08:30 (9 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:
e90d5a8
Parents:
e966aa8
Message:
  • Replace assert failure when pcap header has a bad caplen with a nicer error message
  • Also added error message when an rt_event read fails
Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcapfile.c

    r24ca459 rd8eb866  
    351351
    352352        bytes_to_read = swapl(libtrace,((libtrace_pcapfile_pkt_hdr_t*)packet->buffer)->caplen);
     353
     354        if (bytes_to_read >= LIBTRACE_PACKET_BUFSIZE) {
     355                trace_set_err(libtrace, TRACE_ERR_BAD_PACKET, "Invalid caplen in pcap header (%u) - trace may be corrupt", (uint32_t)bytes_to_read);
     356                return -1;
     357        }
    353358
    354359        assert(bytes_to_read < LIBTRACE_PACKET_BUFSIZE);
  • lib/format_rt.c

    r4eac98f rd8eb866  
    730730                        }
    731731                        else {
     732                                trace_perror(trace, "Error doing a non-blocking read from rt");
    732733                                event.type = TRACE_EVENT_PACKET;
    733734                                break;
Note: See TracChangeset for help on using the changeset viewer.