#error "AC_LIBREPLACE_NETWORK_CHECKS missing in configure"
#endif
+#include <unistd.h>
+
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#endif
#endif
+/*
+ * Some of the functions in source3/lib/util_sock.c use AI_ADDRCONFIG. On QNX
+ * 6.3.0, this macro is defined but, if it's used, getaddrinfo will fail. This
+ * prevents smbd from opening any sockets.
+ *
+ * If I undefine AI_ADDRCONFIG on such systems and define it to be 0,
+ * this works around the issue.
+ */
+#ifdef __QNX__
+#include <sys/neutrino.h>
+#if _NTO_VERSION == 630
+#undef AI_ADDRCONFIG
+#endif
+#endif
#ifndef AI_ADDRCONFIG
/*
* logic copied from AI_NUMERICHOST
#define sockaddr_storage sockaddr_in6
#define ss_family sin6_family
#define HAVE_SS_FAMILY 1
-#else
+#else /*HAVE_STRUCT_SOCKADDR_IN6*/
#define sockaddr_storage sockaddr_in
#define ss_family sin_family
#define HAVE_SS_FAMILY 1
-#endif
-#endif
+#endif /*HAVE_STRUCT_SOCKADDR_IN6*/
+#endif /*HAVE_STRUCT_SOCKADDR_STORAGE*/
#ifndef HAVE_SS_FAMILY
#ifdef HAVE___SS_FAMILY
* which might return 512 or bigger
*/
# define IOV_MAX 512
-# else
-# error IOV_MAX and UIO_MAXIOV undefined
# endif
# endif
#endif
#define ifr_netmask ifr_addr
#endif
-#ifdef SOCKET_WRAPPER
-#ifndef SOCKET_WRAPPER_DISABLE
-#ifndef SOCKET_WRAPPER_NOT_REPLACE
-#define SOCKET_WRAPPER_REPLACE
-#endif /* SOCKET_WRAPPER_NOT_REPLACE */
-#include "../socket_wrapper/socket_wrapper.h"
-#endif /* SOCKET_WRAPPER_DISABLE */
-#endif /* SOCKET_WRAPPER */
+/* Some old Linux systems have broken header files */
+#ifdef HAVE_IPV6
+#ifdef HAVE_LINUX_IPV6_V6ONLY_26
+#define IPV6_V6ONLY 26
+#endif /* HAVE_LINUX_IPV6_V6ONLY_26 */
+#endif /* HAVE_IPV6 */
#endif