Changeset 26c2d4c


Ignore:
Timestamp:
09/25/15 15:04:46 (6 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
f6366a7
Parents:
10553bf
Message:

Fix errors/warnings that appeared on Fedora

Main problem was that we had an inline function that was defined in
a different place to where it was declared.

Also fixed a couple of uninitialised variables that weren't likely to be
a problem but better safe than sorry.

Location:
lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux_common.c

    rf2066fa r26c2d4c  
    452452}
    453453
    454 /**
    455  * Converts a socket, either packet_mmap or standard raw socket into a
    456  * fanout socket.
    457  * NOTE: This means we can read from the socket with multiple queues,
    458  * each must be setup (identically) and then this called upon them
    459  *
    460  * @return 0 success, -1 error
    461  */
    462 inline int linuxcommon_to_packet_fanout(libtrace_t *libtrace,
    463                                         struct linux_per_stream_t *stream)
    464 {
    465         int fanout_opt = ((int)FORMAT_DATA->fanout_flags << 16) |
    466                          (int)FORMAT_DATA->fanout_group;
    467         if (setsockopt(stream->fd, SOL_PACKET, PACKET_FANOUT,
    468                         &fanout_opt, sizeof(fanout_opt)) == -1) {
    469                 trace_set_err(libtrace, TRACE_ERR_INIT_FAILED,
    470                               "Converting the fd to a socket fanout failed %s",
    471                               libtrace->uridata);
    472                 return -1;
    473         }
    474         return 0;
    475 }
    476 
    477454int linuxcommon_pause_input(libtrace_t *libtrace)
    478455{
  • lib/format_linux_common.h

    r9d89626 r26c2d4c  
    313313int linuxcommon_start_input_stream(libtrace_t *libtrace,
    314314                                   struct linux_per_stream_t *stream);
    315 inline int linuxcommon_to_packet_fanout(libtrace_t *libtrace,
    316                                         struct linux_per_stream_t *stream);
    317315int linuxcommon_pause_input(libtrace_t *libtrace);
    318316int linuxcommon_get_fd(const libtrace_t *libtrace);
     
    381379}
    382380
     381/**
     382 * Converts a socket, either packet_mmap or standard raw socket into a
     383 * fanout socket.
     384 * NOTE: This means we can read from the socket with multiple queues,
     385 * each must be setup (identically) and then this called upon them
     386 *
     387 * @return 0 success, -1 error
     388 */
     389static inline int linuxcommon_to_packet_fanout(libtrace_t *libtrace,
     390                                        struct linux_per_stream_t *stream)
     391{
     392        int fanout_opt = ((int)FORMAT_DATA->fanout_flags << 16) |
     393                         (int)FORMAT_DATA->fanout_group;
     394        if (setsockopt(stream->fd, SOL_PACKET, PACKET_FANOUT,
     395                        &fanout_opt, sizeof(fanout_opt)) == -1) {
     396                trace_set_err(libtrace, TRACE_ERR_INIT_FAILED,
     397                              "Converting the fd to a socket fanout failed %s",
     398                              libtrace->uridata);
     399                return -1;
     400        }
     401        return 0;
     402}
     403
     404
    383405#endif /* FORMAT_LINUX_COMMON_H */
  • lib/protocols_pktmeta.c

    rf7bcbfb r26c2d4c  
    175175{
    176176        void *nexthdr;
    177         uint16_t arphrd;
    178         uint16_t next;
     177        uint16_t arphrd = 0;
     178        uint16_t next = 0;
    179179       
    180180        assert(meta != NULL);
Note: See TracChangeset for help on using the changeset viewer.