diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-04-06 13:44:06 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-04-06 13:44:06 -0700 |
commit | 12dbee208706111fb8b4a9eea7935363429f53a0 (patch) | |
tree | 1d2cbbc6776fadc13700bd806b60429fc68190b7 /fad-getad.c | |
parent | d2bdb227148221a2815b25ed5c84b67a90021fe2 (diff) |
Don't try to handle AF_PACKET on Solaris.
Diffstat (limited to 'fad-getad.c')
-rw-r--r-- | fad-getad.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fad-getad.c b/fad-getad.c index f4d5869c..af371d46 100644 --- a/fad-getad.c +++ b/fad-getad.c @@ -60,9 +60,15 @@ static const char rcsid[] _U_ = #include "os-proto.h" #endif -#ifdef AF_PACKET +/* + * We don't do this on Solaris 11 and later, as it appears there aren't + * any AF_PACKET addresses on interfaces, so we don't need this, and + * we end up including both the OS's <net/bpf.h> and our <pcap/bpf.h>, + * and their definitions of some data structures collide. + */ +#if (defined(linux) || defined(__Lynx__)) && defined(AF_PACKET) # ifdef HAVE_NETPACKET_PACKET_H -/* Solaris 11 and later, Linux distributions with newer glibc */ +/* Linux distributions with newer glibc */ # include <netpacket/packet.h> # else /* HAVE_NETPACKET_PACKET_H */ /* LynxOS, Linux distributions with older glibc */ @@ -75,7 +81,7 @@ static const char rcsid[] _U_ = # include <linux/if_packet.h> # endif /* __Lynx__ */ # endif /* HAVE_NETPACKET_PACKET_H */ -#endif /* AF_PACKET */ +#endif /* (defined(linux) || defined(__Lynx__)) && defined(AF_PACKET) */ /* * This is fun. @@ -120,7 +126,7 @@ get_sa_len(struct sockaddr *addr) return (sizeof (struct sockaddr_in6)); #endif -#ifdef AF_PACKET +#if (defined(linux) || defined(__Lynx__)) && defined(AF_PACKET) case AF_PACKET: return (sizeof (struct sockaddr_ll)); #endif |