summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ovsienko <denis@ovsienko.info>2021-08-02 00:32:46 +0100
committerDenis Ovsienko <denis@ovsienko.info>2021-08-02 00:32:46 +0100
commite5bf4ceec7bf1a5a08852ad3a449a5f259f9bed5 (patch)
treeb2e6e9dd523df19bc8fa04360b1bf7a5af4cce3b
parentcae0c6501350fe1d1742211014530a60c2e91f71 (diff)
downloadtcpdump-e5bf4ceec7bf1a5a08852ad3a449a5f259f9bed5.tar.gz
Move capdns from tcpdump.c to addrtoname.c.
Address the warning below (specific to a few versions of Clang, CMake and FreeBSD) and update the exemption rule comment in build.sh. tcpdump.c:244:16: warning: no previous extern declaration for non-static variable 'capdns' [-Wmissing-variable-declarations]
-rw-r--r--addrtoname.c2
-rw-r--r--addrtoname.h5
-rwxr-xr-xbuild.sh2
-rw-r--r--tcpdump.c4
4 files changed, 6 insertions, 7 deletions
diff --git a/addrtoname.c b/addrtoname.c
index 58ced4f9..eb3df77e 100644
--- a/addrtoname.c
+++ b/addrtoname.c
@@ -254,7 +254,7 @@ intoa(uint32_t addr)
static uint32_t f_netmask;
static uint32_t f_localnet;
#ifdef HAVE_CASPER
-extern cap_channel_t *capdns;
+cap_channel_t *capdns;
#endif
/*
diff --git a/addrtoname.h b/addrtoname.h
index 94b41d7b..597f4e1e 100644
--- a/addrtoname.h
+++ b/addrtoname.h
@@ -21,6 +21,11 @@
#include "extract.h"
+#ifdef HAVE_CASPER
+#include <libcasper.h>
+extern cap_channel_t *capdns;
+#endif
+
/*
* Definition to let us compile most of the IPv6 code even on systems
* without IPv6 support.
diff --git a/build.sh b/build.sh
index 3588f81c..16a09458 100755
--- a/build.sh
+++ b/build.sh
@@ -42,8 +42,6 @@ FreeBSD-*/yes)
# [-Werror,-Wc11-extensions]
# tcpdump.c:2443:9: error: '_Generic' is a C11 extension
# [-Werror,-Wc11-extensions]
- # tcpdump.c:244:16: error: no previous extern declaration for non-static variable
- # 'capdns' [-Werror,-Wmissing-variable-declarations]
TCPDUMP_TAINTED=yes
;;
esac
diff --git a/tcpdump.c b/tcpdump.c
index 1e105eba..dc072e1f 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -240,10 +240,6 @@ static int infoprint;
char *program_name;
-#ifdef HAVE_CASPER
-cap_channel_t *capdns;
-#endif
-
/* Forwards */
static void (*setsignal (int sig, void (*func)(int)))(int);
static void cleanup(int);