Hello all,

I enabled -Wall on my RHL 6.2 system and got two implicit declarations:

./addrtoname.c: In function `etheraddr_string':
./addrtoname.c:408: warning: implicit declaration of function `ether_ntohost'

./setsignal.c:72: warning: implicit declaration of function `sigset'
./setsignal.c:72: warning: return makes pointer from integer without a
cast

I believe HAVE_SIGSET is misdetected in this case, as I can't find
references to it in the headers either.

ether_ntohost seems to be in diverse locations: netinet/ether.h (linux) or
net/ethernet.h (FreeBSD).  Linux also has net/ethernet.h so this is a
little tricky..

Attached is somekind of a patch to fix the former.  Probably a non-optimal
approach, but here we go..

-- 
Pekka Savola                  "Tell me of difficulties surmounted,
Netcore Oy                    not those you stumble over and fall"
Systems. Networks. Security.   -- Robert Jordan: A Crown of Swords
diff -uNr tcpdump/addrtoname.c tcpdump.fix/addrtoname.c
--- tcpdump/addrtoname.c        Mon Jan  1 03:29:31 2001
+++ tcpdump.fix/addrtoname.c    Mon Jan  1 13:34:41 2001
@@ -58,6 +58,16 @@
 #include "llc.h"
 #include "setsignal.h"
 
+#ifdef HAVE_ETHER_NTOHOST
+# ifdef HAVE_NETINET_ETHER_H   /* Linux: ether_ntohost */
+#  include <netinet/ether.h>
+# else
+#  ifdef HAVE_NET_ETHERNET_H   /* BSD: ether_ntohost */
+#   include <net/ethernet.h>
+#  endif
+# endif
+#endif
+
 /* Forwards */
 static RETSIGTYPE nohostname(int);
 
Binary files tcpdump/addrtoname.o and tcpdump.fix/addrtoname.o differ
diff -uNr tcpdump/config.h.in tcpdump.fix/config.h.in
--- tcpdump/config.h.in Tue Dec 12 11:19:27 2000
+++ tcpdump.fix/config.h.in     Mon Jan  1 13:31:58 2001
@@ -175,6 +163,12 @@
 
 /* Define if you have the <fcntl.h> header file.  */
 #undef HAVE_FCNTL_H
+
+/* Define if you have the <net/ethernet.h> header file.  */
+#undef HAVE_NET_ETHERNET_H
+
+/* Define if you have the <netinet/ether.h> header file.  */
+#undef HAVE_NETINET_ETHER_H
 
 /* Define if you have the <rc5.h> header file.  */
 #undef HAVE_RC5_H
diff -uNr tcpdump/configure.in tcpdump.fix/configure.in
--- tcpdump/configure.in        Mon Jan  1 03:29:31 2001
+++ tcpdump.fix/configure.in    Mon Jan  1 13:30:08 2001
@@ -452,6 +452,7 @@
 
 AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy)
 AC_CHECK_FUNCS(ether_ntohost setlinebuf)
+AC_CHECK_HEADERS(netinet/ether.h net/ethernet.h)
 
 usegetipnodeby=yes
 AC_CHECK_FUNCS(getipnodebyname getipnodebyaddr freeaddrinfo,
Binary files tcpdump/tcpdump and tcpdump.fix/tcpdump differ

Reply via email to