summaryrefslogtreecommitdiff
path: root/deps/cares/src/ares_init.c
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-05-14 01:54:58 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-05-14 02:07:35 +0200
commit9498fd15c70c2daf386dda13c43d7a2d984f0892 (patch)
tree77972dbe7fd421211d894ef5b112b2cfabebe22e /deps/cares/src/ares_init.c
parent458c8bb9f86f1666cbbbe1f2951e7ca86756c48f (diff)
downloadandroid-node-v8-9498fd15c70c2daf386dda13c43d7a2d984f0892.tar.gz
android-node-v8-9498fd15c70c2daf386dda13c43d7a2d984f0892.tar.bz2
android-node-v8-9498fd15c70c2daf386dda13c43d7a2d984f0892.zip
deps: upgrade c-ares to 1.10.0
Diffstat (limited to 'deps/cares/src/ares_init.c')
-rw-r--r--deps/cares/src/ares_init.c44
1 files changed, 10 insertions, 34 deletions
diff --git a/deps/cares/src/ares_init.c b/deps/cares/src/ares_init.c
index 4aef21ad47..d23c1b0ca3 100644
--- a/deps/cares/src/ares_init.c
+++ b/deps/cares/src/ares_init.c
@@ -1,6 +1,6 @@
/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2007-2012 by Daniel Stenberg
+ * Copyright (C) 2007-2013 by Daniel Stenberg
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
@@ -21,14 +21,6 @@
#include <sys/param.h>
#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
@@ -50,16 +42,6 @@
# include <arpa/nameser_compat.h>
#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-
#if defined(ANDROID) || defined(__ANDROID__)
#include <sys/system_properties.h>
/* From the Bionic sources */
@@ -68,8 +50,7 @@
#endif
#include "ares.h"
-#include "inet_ntop.h"
-#include "inet_net_pton.h"
+#include "ares_inet_net_pton.h"
#include "ares_library_init.h"
#include "ares_nowarn.h"
#include "ares_platform.h"
@@ -163,6 +144,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
channel->rotate = -1;
channel->udp_port = -1;
channel->tcp_port = -1;
+ channel->ednspsz = -1;
channel->socket_send_buffer_size = -1;
channel->socket_receive_buffer_size = -1;
channel->nservers = -1;
@@ -453,6 +435,9 @@ static int init_by_options(ares_channel channel,
&& channel->socket_receive_buffer_size == -1)
channel->socket_receive_buffer_size = options->socket_receive_buffer_size;
+ if ((optmask & ARES_OPT_EDNSPSZ) && channel->ednspsz == -1)
+ channel->ednspsz = options->ednspsz;
+
/* Copy the IPv4 servers, if given. */
if ((optmask & ARES_OPT_SERVERS) && channel->nservers == -1)
{
@@ -1012,15 +997,10 @@ static int get_DNS_AdaptersAddresses(char **outptr)
}
else if (namesrvr.sa->sa_family == AF_INET6)
{
- /* Windows apparently always reports some IPv6 DNS servers that
- * prefixed with fec0:0:0:ffff. These ususally do not point to
- * working DNS servers, so we ignore them. */
- if (strncmp(txtaddr, "fec0:0:0:ffff:", 14) == 0)
- continue;
if (memcmp(&namesrvr.sa6->sin6_addr, &ares_in6addr_any,
sizeof(namesrvr.sa6->sin6_addr)) == 0)
continue;
- if (! ares_inet_ntop(AF_INET, &namesrvr.sa6->sin6_addr,
+ if (! ares_inet_ntop(AF_INET6, &namesrvr.sa6->sin6_addr,
txtaddr, sizeof(txtaddr)))
continue;
}
@@ -1363,6 +1343,9 @@ static int init_by_defaults(ares_channel channel)
if (channel->tcp_port == -1)
channel->tcp_port = htons(NAMESERVER_PORT);
+ if (channel->ednspsz == -1)
+ channel->ednspsz = EDNSPACKETSZ;
+
if (channel->nservers == -1) {
/* If nobody specified servers, try a local named. */
channel->servers = malloc(sizeof(struct server_state));
@@ -1960,13 +1943,6 @@ static int init_id_key(rc4_key* key,int key_data_len)
return ARES_SUCCESS;
}
-unsigned short ares__generate_new_id(rc4_key* key)
-{
- unsigned short r=0;
- ares__rc4(key, (unsigned char *)&r, sizeof(r));
- return r;
-}
-
void ares_set_local_ip4(ares_channel channel, unsigned int local_ip)
{
channel->local_ip4 = local_ip;