Skip to content

Commit

Permalink
Don't try to handle AF_PACKET on Solaris.
Browse files Browse the repository at this point in the history
  • Loading branch information
guyharris committed Apr 6, 2013
1 parent d2bdb22 commit 12dbee2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions fad-getad.c
Expand Up @@ -60,9 +60,15 @@ static const char rcsid[] _U_ =
#include "os-proto.h" #include "os-proto.h"
#endif #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 # ifdef HAVE_NETPACKET_PACKET_H
/* Solaris 11 and later, Linux distributions with newer glibc */ /* Linux distributions with newer glibc */
# include <netpacket/packet.h> # include <netpacket/packet.h>
# else /* HAVE_NETPACKET_PACKET_H */ # else /* HAVE_NETPACKET_PACKET_H */
/* LynxOS, Linux distributions with older glibc */ /* LynxOS, Linux distributions with older glibc */
Expand All @@ -75,7 +81,7 @@ static const char rcsid[] _U_ =
# include <linux/if_packet.h> # include <linux/if_packet.h>
# endif /* __Lynx__ */ # endif /* __Lynx__ */
# endif /* HAVE_NETPACKET_PACKET_H */ # endif /* HAVE_NETPACKET_PACKET_H */
#endif /* AF_PACKET */ #endif /* (defined(linux) || defined(__Lynx__)) && defined(AF_PACKET) */


/* /*
* This is fun. * This is fun.
Expand Down Expand Up @@ -120,7 +126,7 @@ get_sa_len(struct sockaddr *addr)
return (sizeof (struct sockaddr_in6)); return (sizeof (struct sockaddr_in6));
#endif #endif


#ifdef AF_PACKET #if (defined(linux) || defined(__Lynx__)) && defined(AF_PACKET)
case AF_PACKET: case AF_PACKET:
return (sizeof (struct sockaddr_ll)); return (sizeof (struct sockaddr_ll));
#endif #endif
Expand Down

0 comments on commit 12dbee2

Please sign in to comment.