mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-24 02:23:27 +08:00
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>.
This commit is contained in:
parent
4c6bada758
commit
f36c32b514
14
addrtoname.c
14
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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user