/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2009 by Alexander Barton (alex@barton.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
-#ifndef WANT_IPV6
-#ifdef h_errno
+#if !defined(HAVE_GETADDRINFO) || !defined(HAVE_GETNAMEINFO)
+#if !defined(WANT_IPV6) && defined(h_errno)
static char *
Get_Error( int H_Error )
{
}
return "unknown error";
}
-#endif /* h_errno */
-#endif /* WANT_IPV6 */
+#endif
+#endif
/* Do "IDENT" (aka "AUTH") lookup and append result to resolved_addr array */
* the IP address in resbuf and returns false.
* @param IpAddr ip address to resolve
* @param resbuf result buffer to store DNS name/string representation of ip address
- * @reslen size of result buffer (must be >= NGT_INET_ADDRSTRLEN)
+ * @param reslen size of result buffer (must be >= NGT_INET_ADDRSTRLEN)
* @return true if reverse lookup successful, false otherwise
*/
static bool
*resbuf = 0;
res = getnameinfo((struct sockaddr *) IpAddr, ng_ipaddr_salen(IpAddr),
- resbuf, reslen, NULL, 0, NI_NAMEREQD);
+ resbuf, (socklen_t)reslen, NULL, 0, NI_NAMEREQD);
if (res == 0)
return true;
if (!Conf_ConnectIPv4)
hints.ai_family = AF_INET6;
#endif
+ memset(&addr, 0, sizeof(addr));
+
res = getaddrinfo(hostname, NULL, &hints, &ai_results);
switch (res) {
case 0: break;
Resolve_Shutdown(s);
return (size_t)bytes_read;
}
-/* -eof- */
+
+/* -eof- */