]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Move capdns from tcpdump.c to addrtoname.c.
authorDenis Ovsienko <[email protected]>
Sun, 1 Aug 2021 23:32:46 +0000 (00:32 +0100)
committerDenis Ovsienko <[email protected]>
Sun, 1 Aug 2021 23:32:46 +0000 (00:32 +0100)
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]

addrtoname.c
addrtoname.h
build.sh
tcpdump.c

index 58ced4f9b5ef971dd61e3b94972817965a600bb0..eb3df77ee7ea2ebad9e6591075013ecac3cde691 100644 (file)
@@ -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
 
 /*
index 94b41d7bee2c2b55c4219385a70a25f93564c1e3..597f4e1edcf0d3b25302d1faa504b552f3a6b6c2 100644 (file)
 
 #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.
index 3588f81c2a63ab8805e2f82b62966283db523ea1..16a0945878085aa08b762f80cd20fa67c7baa0eb 100755 (executable)
--- 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
index 1e105eba60570d45874deb2b7a5308481dd9dca3..dc072e1ff9c2123f52792533f000723be18ca377 100644 (file)
--- 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);