summaryrefslogtreecommitdiff
path: root/addrtoname.c
diff options
context:
space:
mode:
authorguy <guy>2002-06-02 00:07:36 +0000
committerguy <guy>2002-06-02 00:07:36 +0000
commitf36c32b514992362fd6d20971c8d3e4bbf3ef51e (patch)
treeabf590744fc2f7d06c5aa8d2414cc4bb416aaf2a /addrtoname.c
parent4c6bada75863c064314bc52daf899e37cc8b39e3 (diff)
downloadtcpdump-f36c32b514992362fd6d20971c8d3e4bbf3ef51e.tar.gz
Don't bother including <netinet/if_ether.h> if we're not using
"ether_ntohost()" - the only reason we include it is to get "ether_ntohost()" declared. We only include <net/if.h> to get "struct ifnet" in "struct arpcom" defined on Solaris, so that we don't get errors when including <netinet/if_ether.h>, so don't include that unless we're including <netinet/if_ether.h>. We only need incomplete definitions for "struct mbuf" and "struct rtentry" if we're including <net/if.h>, so don't define them unless we're including <netinet/if_ether.h>.
Diffstat (limited to 'addrtoname.c')
-rw-r--r--addrtoname.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/addrtoname.c b/addrtoname.c
index 417488de..cb754434 100644
--- a/addrtoname.c
+++ b/addrtoname.c
@@ -23,7 +23,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.87 2002-05-31 09:51:13 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.88 2002-06-02 00:07:36 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -34,14 +34,16 @@ static const char rcsid[] =
#include <sys/socket.h>
#include <sys/time.h>
-struct mbuf;
-struct rtentry;
-#include <net/if.h>
-
#include <netinet/in.h>
+
+#ifdef USE_ETHER_NTOHOST
#ifdef HAVE_NETINET_IF_ETHER_H
+struct mbuf; /* Squelch compiler warnings on some platforms for */
+struct rtentry; /* declarations in <net/if.h> */
+#include <net/if.h> /* for "struct ifnet" in "struct arpcom" on Solaris */
#include <netinet/if_ether.h>
-#endif
+#endif /* HAVE_NETINET_IF_ETHER_H */
+#endif /* USE_ETHER_NTOHOST */
#include <arpa/inet.h>