Ignore:
Timestamp:
11/16/17 10:37:56 (3 years ago)
Author:
Robert A Zeh <razeh@…>
Branches:
cachetimestamps, develop, dpdk-ndag, etsilive, master, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
Children:
9726d0e
Parents:
be32cc7
git-author:
Robert A Zeh <robert.a.zeh@…> (11/16/17 10:36:16)
git-committer:
Robert A Zeh <razeh@…> (11/16/17 10:37:56)
Message:

Add TRACE_ERR_WANDIO_FAILED for wandio error reporting.

Passing an errcode of 0 to trace_set_err triggers the assertion at
format_helper.c:290, making the error unrecoverable for the calling
code. This happens when the wandio layer encounters an error while
errno is still 0 (for example, an incomplete pcap packet).

To make the error recoverable, pass in TRACE_ERR_WANDIO_FAILED instead
of errno.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcapfile.c

    r633339d r2c457ec  
    357357                        sizeof(libtrace_pcapfile_pkt_hdr_t));
    358358        if (err<0) {
    359                 trace_set_err(libtrace,errno,"reading packet");
     359                trace_set_err(libtrace,TRACE_ERR_WANDIO_FAILED,"reading packet");
    360360                return -1;
    361361        }
     
    366366
    367367        if (err < (int)sizeof(libtrace_pcapfile_pkt_hdr_t)) {
    368                 trace_set_err(libtrace, errno, "Incomplete pcap packet header");
     368                trace_set_err(libtrace, TRACE_ERR_BAD_PACKET, "Incomplete pcap packet header");
    369369                return -1;
    370370        }
     
    393393
    394394        if (err<0) {
    395                 trace_set_err(libtrace,errno,"reading packet");
     395                trace_set_err(libtrace,TRACE_ERR_WANDIO_FAILED,"reading packet");
    396396                return -1;
    397397        }
     
    401401
    402402        if (err < (int)bytes_to_read) {
    403                 trace_set_err(libtrace, errno, "Incomplete pcap packet body");
     403                trace_set_err(libtrace, TRACE_ERR_WANDIO_FAILED, "Incomplete pcap packet body");
    404404                return -1;
    405405        }
Note: See TracChangeset for help on using the changeset viewer.