Changeset f7bcbfb for lib/linktypes.c


Ignore:
Timestamp:
02/21/14 10:38:06 (8 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/linktypes.c

    r77f79c7 rf7bcbfb  
    6767                case TRACE_DLT_OPENBSD_LOOP: return TRACE_TYPE_OPENBSD_LOOP;
    6868                /* Unhandled */
     69                case TRACE_DLT_ERROR:
    6970                case TRACE_DLT_NULL:    /* Raw IP frame with a BSD specific
    7071                                         * header If you want raw L3 headers
     
    7374                        break;
    7475        }
    75         return ~0U;
     76        return TRACE_TYPE_UNKNOWN;
    7677}
    7778
     
    115116                case TRACE_TYPE_NONDATA:
    116117                        break;
    117         }
    118         return ~0U;
     118                case TRACE_TYPE_UNKNOWN:
     119                        break;
     120        }
     121        return TRACE_DLT_ERROR;
    119122}
    120123
     
    203206                case TRACE_TYPE_NONDATA:
    204207                case TRACE_TYPE_OPENBSD_LOOP:
     208                case TRACE_TYPE_UNKNOWN:
    205209                        break;
    206210        }
Note: See TracChangeset for help on using the changeset viewer.