diff -r 805467de22fc configure.ac --- a/configure.ac Sun Nov 06 13:19:38 2016 +0200 +++ b/configure.ac Mon Nov 07 21:21:04 2016 +0100 @@ -3408,7 +3408,6 @@ futimens futimes gai_strerror getentropy \ getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \ getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \ - if_nameindex \ initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \ memrchr mbrtowc mkdirat mkfifo \ mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \ @@ -3761,6 +3760,20 @@ AC_MSG_RESULT(no) ]) +# On Android API level 24, the if_nameindex structure is not defined in +# net/if.h even though the if_nameindex() is correctly linked by +# AC_CHECK_FUNCS. +AC_MSG_CHECKING(for if_nameindex) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_NET_IF_H +# include +#endif +]], [[struct if_nameindex *ni = if_nameindex(); int x = ni[0].if_index;]])], + [AC_DEFINE(HAVE_IF_NAMEINDEX, 1, Define to 1 if you have the 'if_nameindex' function.) + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) +]) + # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. AC_MSG_CHECKING(for getaddrinfo)