aboutsummaryrefslogtreecommitdiff
path: root/fad-getad.c
diff options
context:
space:
mode:
Diffstat (limited to 'fad-getad.c')
-rw-r--r--fad-getad.c14
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