projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove doc/es/ and src/device.c from the distribution.
[tinc]
/
lib
/
fake-getaddrinfo.c
diff --git
a/lib/fake-getaddrinfo.c
b/lib/fake-getaddrinfo.c
index
a1d36b1
..
29b3f9b
100644
(file)
--- a/
lib/fake-getaddrinfo.c
+++ b/
lib/fake-getaddrinfo.c
@@
-9,16
+9,10
@@
* that ai_family is AF_INET. Don't use it for another purpose.
*/
* that ai_family is AF_INET. Don't use it for another purpose.
*/
-#include "config.h"
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <string.h>
-
-#include <system.h>
+#include "system.h"
+#include "ipv4.h"
+#include "ipv6.h"
#include "fake-getaddrinfo.h"
#ifndef HAVE_GAI_STRERROR
#include "fake-getaddrinfo.h"
#ifndef HAVE_GAI_STRERROR
@@
-48,7
+42,7
@@
void freeaddrinfo(struct addrinfo *ai)
#endif /* !HAVE_FREEADDRINFO */
#ifndef HAVE_GETADDRINFO
#endif /* !HAVE_FREEADDRINFO */
#ifndef HAVE_GETADDRINFO
-static struct addrinfo *malloc_ai(int port, u
_long
addr)
+static struct addrinfo *malloc_ai(int port, u
int32_t
addr)
{
struct addrinfo *ai;
{
struct addrinfo *ai;
@@
-96,12
+90,14
@@
int getaddrinfo(const char *hostname, const char *servname,
return EAI_MEMORY;
}
return EAI_MEMORY;
}
+#ifdef HAVE_INET_ATON
if (inet_aton(hostname, &in)) {
if (NULL != (*res = malloc_ai(port, in.s_addr)))
return 0;
else
return EAI_MEMORY;
}
if (inet_aton(hostname, &in)) {
if (NULL != (*res = malloc_ai(port, in.s_addr)))
return 0;
else
return EAI_MEMORY;
}
+#endif
hp = gethostbyname(hostname);
if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) {
hp = gethostbyname(hostname);
if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) {