Ignore:
Timestamp:
06/21/17 15:41:47 (4 years ago)
Author:
Richard Sanger <rsanger@…>
Branches:
cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
Children:
e9c089a
Parents:
f398c61
Message:

Fix issue #49 compile issues when missing BPF header file

If pcap was installed but somehow the BPF header was missing.
Libtrace was using two different macros HAVE_BPF and HAVE_BPF_FILTER
to determine if BPF was installed.

HAVE_BPF_FILTER was set if pcap was found, wereas HAVE_BPF was
set if the BPF header was found.

This removes and replaces HAVE_BPF_FILTER with HAVE_BPF.
It also adds ifdef blocks around formats that try to install
BPF filters directly as needed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux_common.c

    rdb84bb2 rd47ca18  
    6161static int linuxnative_configure_bpf(libtrace_t *libtrace,
    6262                libtrace_filter_t *filter) {
    63 #ifdef HAVE_LIBPCAP
     63#if defined(HAVE_LIBPCAP) && defined(HAVE_BPF)
    6464        struct ifreq ifr;
    6565        unsigned int arphrd;
     
    125125        return 0;
    126126#else
    127         return -1
     127        return -1;
    128128#endif
    129129}
     
    404404         * pre-compiled.
    405405         */
     406#ifdef HAVE_BPF
    406407        if (filter != NULL) {
    407408                /* Check if the filter was successfully compiled. If not,
     
    424425                }
    425426        }
     427#endif
    426428
    427429        /* Consume any buffered packets that were received before the socket
Note: See TracChangeset for help on using the changeset viewer.