Autoconf test for <net/if_ether.h> needed for GNU/kfreebsd.
If possible, define ETHERTYPE_IPV6 as ETH_P_IPV6.
# Some OSes (Solaris) need sys/filio.h for FIONBIO
AC_CHECK_HEADERS(sys/filio.h)
+# GNU/kfreebsd needs net/if_ether.h for ETH_P_IPV6
+AC_CHECK_HEADERS(net/if_ether.h)
+
AC_CONFIG_FILES([Makefile darkstat.8])
AC_OUTPUT
#endif
#ifndef ETHERTYPE_IPV6
-# include <net/if_ether.h> /* ETH_P_IPV6 for GNU/kfreebsd */
-# define ETHERTYPE_IPV6 ETH_P_IPV6
+# ifdef HAVE_NET_IF_ETHER_H
+# include <net/if_ether.h> /* ETH_P_IPV6 for GNU/kfreebsd */
+# endif
+# ifdef ETH_P_IPV6
+# define ETHERTYPE_IPV6 ETH_P_IPV6
+# endif
#endif
#include <net/if.h> /* struct ifreq */