commit - e379a0881e0f525d965e7bffaaf2e9858dc49068
commit + 21ef762109dcb26cb2ccbda56b50472ada697477
blob - b9e92704e9fab7bcb1dfac7d36d63ffb2a8c0a6d
blob + 11482399cf46260f1d52c69a4ed1dd09ea17793f
--- configure.ng
+++ configure.ng
fi
])
+AC_DEFUN([WORKING_GETADDRINFO],[
+ AC_CHECK_FUNCS([getaddrinfo],[
+ AC_MSG_CHECKING([whether getaddrinfo() works])
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+int
+main(int argc, char **argv)
+{
+ struct addrinfo hints, *ai;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_family = PF_UNSPEC;
+ if(getaddrinfo(NULL, "0", &hints, &ai) != 0)
+ return 1;
+ return 0;
+}
+ ],[
+ AC_DEFINE([HAVE_WORKING_GETADDRINFO], 1, [getaddrinfo(0)])
+ AC_MSG_RESULT(yes)
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ ])
+])
+
if test "$GCC" = "yes"; then
# We are using the GNU C compiler. Good!
CFLAGS="$CFLAGS -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes"
AC_MSG_ERROR([required function missing!]))
# Optional functions
-AC_CHECK_FUNCS_ONCE([ \
- arc4random arc4random_stir gai_strerror getaddrinfo getnameinfo inet_aton
+AC_CHECK_FUNCS_ONCE([
+ arc4random arc4random_stir gai_strerror getnameinfo inet_aton \
sigaction sigprocmask snprintf vsnprintf strdup strndup strlcpy strlcat \
strtok_r unsetenv waitpid])
+WORKING_GETADDRINFO
+
# -- Configuration options --
# use syslog?
blob - 9cf35ec976325f312dc30672ad8e8fc417b96e90
blob + 37f75b6de919f64d7ddbdfb9ac24a5b3d0e51a75
--- src/ipaddr/ng_ipaddr.c
+++ src/ipaddr/ng_ipaddr.c
GLOBAL bool
ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port)
{
-#ifdef HAVE_GETADDRINFO
+#ifdef HAVE_WORKING_GETADDRINFO
int ret;
char portstr[64];
struct addrinfo *res0;
blob - 6078da8b48a9b6adecec99761f9ea7c2ec1f2188
blob + 01f730cc868a67458e7120cfc6d1e1485b9c4aa8
--- src/ngircd/resolve.c
+++ src/ngircd/resolve.c
{
ng_ipaddr_t addr;
-#ifdef HAVE_GETADDRINFO
+#ifdef HAVE_WORKING_GETADDRINFO
int res;
struct addrinfo *a, *ai_results;
static struct addrinfo hints;