Update to c-ares 1.7.1 and redo the config patch to also support

IPv6 nameserver addresses.
This commit is contained in:
Peter Pentchev 2010-03-25 11:54:02 +00:00
parent e4978089e8
commit 27109dac2c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=251488
4 changed files with 36 additions and 13 deletions

View File

@ -6,7 +6,7 @@
#
PORTNAME= c-ares
PORTVERSION= 1.7.0
PORTVERSION= 1.7.1
CATEGORIES= dns
MASTER_SITES= http://c-ares.haxx.se/
@ -58,6 +58,7 @@ MAN3= ares_cancel.3 \
ares_expand_name.3 ares_expand_string.3 \
ares_fds.3 \
ares_free_data.3 ares_free_hostent.3 ares_free_string.3 \
ares_get_servers.3 \
ares_gethostbyaddr.3 ares_gethostbyname.3 ares_gethostbyname_file.3 \
ares_getnameinfo.3 \
ares_getsock.3 \
@ -70,6 +71,7 @@ MAN3= ares_cancel.3 \
ares_query.3 \
ares_search.3 \
ares_send.3 ares_set_socket_callback.3 \
ares_set_servers.3 \
ares_strerror.3 \
ares_timeout.3 \
ares_version.3 \

View File

@ -1,3 +1,3 @@
MD5 (c-ares-1.7.0.tar.gz) = 15ab7852306b554b0b1145f41005a3bb
SHA256 (c-ares-1.7.0.tar.gz) = c6b7104c25426778c1db66ee6cdaad028fad243c5c42c09cc638bd85c985fae3
SIZE (c-ares-1.7.0.tar.gz) = 617652
MD5 (c-ares-1.7.1.tar.gz) = dc7e0f32e92613aed9aff233a6b69753
SHA256 (c-ares-1.7.1.tar.gz) = d34386e3beac222deeff34cecc3ffd8d1a1b4717f7e94f84ff96434bab613ad7
SIZE (c-ares-1.7.1.tar.gz) = 626876

View File

@ -1,7 +1,10 @@
Description: Add the ares_get_config() routine used by Unreal IRCd.
Originally taken from the Unreal IRCd distribution, later modified
by me to properly support IPv6 nameserver addresses since c-ares-1.7.1.
Origin: the Unreal IRCd distribution
Author: Peter Pentchev <roam@FreeBSD.org>
Forwarded: no
Last-Update: 2010-03-22
Last-Update: 2010-03-25
--- ares.h.orig
+++ ares.h
@ -20,9 +23,9 @@ Last-Update: 2010-03-22
struct hostent;
struct timeval;
struct sockaddr;
@@ -487,6 +495,8 @@
CARES_EXTERN const char *ares_strerror(int code);
@@ -502,6 +510,8 @@
CARES_EXTERN int ares_get_servers(ares_channel channel,
struct ares_addr_node **servers);
+CARES_EXTERN int ares_get_config(struct ares_config_info *d, ares_channel c);
+
@ -31,14 +34,23 @@ Last-Update: 2010-03-22
#endif
--- ares_init.c.orig
+++ ares_init.c
@@ -1498,6 +1498,26 @@
@@ -67,6 +67,7 @@
#include <errno.h>
#include "ares.h"
#include "inet_net_pton.h"
+#include "inet_ntop.h"
#include "ares_library_init.h"
#include "ares_private.h"
@@ -1520,6 +1521,36 @@
}
#endif /* !WIN32 && !WATT32 */
+int ares_get_config(struct ares_config_info *d, ares_channel c)
+{
+ int i;
+ char *p;
+ const char *p;
+ char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
+
+ memset(d, 0, sizeof(struct ares_config_info));
+
@ -48,7 +60,16 @@ Last-Update: 2010-03-22
+ d->servers = calloc(sizeof(char *), c->nservers);
+ for (i = 0; i < c->nservers; i++)
+ {
+ p = inet_ntoa(c->servers[i].addr);
+ if (c->servers[i].addr.family == AF_INET)
+ p = ares_inet_ntop(c->servers[i].addr.family,
+ (const char *)&c->servers[i].addr.addrV4,
+ tmp, sizeof(tmp));
+ else if (c->servers[i].addr.family == AF_INET6)
+ p = ares_inet_ntop(c->servers[i].addr.family,
+ (const char *)&c->servers[i].addr.addrV6,
+ tmp, sizeof(tmp));
+ else
+ p = NULL;
+ d->servers[i] = p ? strdup(p) : NULL;
+ }
+

View File

@ -1,11 +1,11 @@
Description: Place the pkgconfig file in the correct directory on FreeBSD.
Author: Peter Pentchev <roam@FreeBSD.org>
Forwarded: not-needed
Last-Update: 2009-03-22
Last-Update: 2009-03-25
--- Makefile.in.orig
+++ Makefile.in
@@ -316,7 +316,7 @@
@@ -317,7 +317,7 @@
CLEANFILES = $(PDFPAGES) $(HTMLPAGES)
DISTCLEANFILES = ares_build.h