Changeset f7bcbfb for lib/trace.c


Ignore:
Timestamp:
02/21/14 10:38:06 (7 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:
a31777e
Parents:
86bec15
Message:

Fixed warnings that cropped up when building with clang

  • Added proper "unknown" or "error" values to some libtrace enums. This removes the need for the hideous ==~0U checks that we used to do to check for errors and should be a bit more robust.
  • Fixed potential strncat bugs in one of the libpacketdump decoders.
  • Changed some null-ops in ior-peek as our current method was triggering warnings.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    rc04929c rf7bcbfb  
    10751075        if (packet->link_type == 0) {
    10761076                if (!packet->trace->format->get_link_type)
    1077                         return (libtrace_linktype_t)-1;
     1077                        return TRACE_TYPE_UNKNOWN;
    10781078                ((libtrace_packet_t *)packet)->link_type =
    10791079                        packet->trace->format->get_link_type(packet);
     
    12161216                        return -1;
    12171217                }
    1218                 if (libtrace_to_pcap_dlt(linktype) == ~1U) {
     1218                if (libtrace_to_pcap_dlt(linktype) == TRACE_DLT_ERROR) {
    12191219                        trace_set_err(packet->trace,TRACE_ERR_BAD_FILTER,
    12201220                                        "Unknown pcap equivalent linktype");
     
    12671267                return 1;       
    12681268
    1269         if (libtrace_to_pcap_dlt(linktype)==~0U) {
     1269        if (libtrace_to_pcap_dlt(linktype)==TRACE_DLT_ERROR) {
    12701270               
    12711271                /* If we cannot get a suitable DLT for the packet, it may
     
    12801280                free_packet_needed=true;
    12811281
    1282                 while (libtrace_to_pcap_dlt(linktype) == ~0U) {
     1282                while (libtrace_to_pcap_dlt(linktype) == TRACE_DLT_ERROR) {
    12831283                        if (!demote_packet(packet_copy)) {
    12841284                                trace_set_err(packet->trace,
Note: See TracChangeset for help on using the changeset viewer.