From 62435b794629f366206b71d90ab1b1a677bf2e52 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 4 Dec 2006 11:04:17 +0100 Subject: [PATCH] dns plugin: Fixed a compile error if pcap.h is not found. If pcap.h is not found, the compiler complains about some "defined but not used" warnings. As we're using -Werror this causes the build to abort. Signed-off-by: Sebastian Harl --- src/utils_dns.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/utils_dns.c b/src/utils_dns.c index 2f6c1912..2c710093 100644 --- a/src/utils_dns.c +++ b/src/utils_dns.c @@ -154,15 +154,17 @@ static pcap_t *pcap_obj = NULL; static ip_list_t *IgnoreList = NULL; +#if HAVE_PCAP_H static void (*Callback) (const rfc1035_header_t *) = NULL; static int query_count_intvl = 0; static int query_count_total = 0; -#ifdef __OpenBSD__ +# ifdef __OpenBSD__ static struct bpf_timeval last_ts; -#else +# else static struct timeval last_ts; -#endif +# endif /* __OpenBSD__ */ +#endif /* HAVE_PCAP_H */ static int cmp_in6_addr (const struct in6_addr *a, const struct in6_addr *b) @@ -240,6 +242,7 @@ void ignore_list_add_name (const char *name) freeaddrinfo (ai_list); } +#if HAVE_PCAP_H static void in6_addr_from_buffer (struct in6_addr *ia, const void *buf, size_t buf_len, int family) @@ -256,12 +259,10 @@ static void in6_addr_from_buffer (struct in6_addr *ia, } } /* void in6_addr_from_buffer */ -#if HAVE_PCAP_H void dnstop_set_pcap_obj (pcap_t *po) { pcap_obj = po; } -#endif void dnstop_set_callback (void (*cb) (const rfc1035_header_t *)) { @@ -594,7 +595,6 @@ handle_ether(const u_char * pkt, int len) } /* public function */ -#if HAVE_PCAP_H void handle_pcap(u_char *udata, const struct pcap_pkthdr *hdr, const u_char *pkt) { int status; @@ -642,7 +642,7 @@ void handle_pcap(u_char *udata, const struct pcap_pkthdr *hdr, const u_char *pkt query_count_total++; last_ts = hdr->ts; } -#endif +#endif /* HAVE_PCAP_H */ const char *qtype_str(int t) { -- 2.11.0