Use this information rather than hard-coding "if Linux …"
# Checks for library functions.
#
AC_PROG_GCC_TRADITIONAL
-AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf)
+AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf if_indextoname)
AC_FUNC_STRERROR_R
}
}
-#if KERNEL_LINUX
+#if defined(HAVE_IF_INDEXTONAME) && HAVE_IF_INDEXTONAME && defined(SO_BINDTODEVICE)
if (se->interface != 0)
{
char interface_name[IFNAMSIZ];
return (-1);
}
}
-#endif
+#endif /* HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */
return (0);
} /* }}} network_set_interface */
}
}
-#if KERNEL_LINUX
+#if defined(HAVE_IF_INDEXTONAME) && HAVE_IF_INDEXTONAME && defined(SO_BINDTODEVICE)
/* if a specific interface was set, bind the socket to it. But to avoid
* possible problems with multicast routing, only do that for non-multicast
* addresses */
return (-1);
}
}
-#endif
+#endif /* HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */
return (0);
} /* int network_bind_socket */