aboutsummaryrefslogtreecommitdiff
path: root/dns/c-ares
diff options
context:
space:
mode:
Diffstat (limited to 'dns/c-ares')
-rw-r--r--dns/c-ares/Makefile15
-rw-r--r--dns/c-ares/distinfo6
-rw-r--r--dns/c-ares/files/ares-config-info.patch54
3 files changed, 69 insertions, 6 deletions
diff --git a/dns/c-ares/Makefile b/dns/c-ares/Makefile
index 3912a0af31c6..42a9e3d19bbf 100644
--- a/dns/c-ares/Makefile
+++ b/dns/c-ares/Makefile
@@ -6,16 +6,24 @@
#
PORTNAME= c-ares
-PORTVERSION= 1.3.1
-PORTREVISION= 1
+PORTVERSION= 1.3.2
CATEGORIES= dns
MASTER_SITES= http://daniel.haxx.se/projects/c-ares/
MAINTAINER= roam@FreeBSD.org
COMMENT= An asynchronous DNS resolver library
+OPTIONS= CONFIG_INFO "Add the ares_config_info patch" ON
+
CONFLICTS= ares-1.*
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_CONFIG_INFO)
+EXTRA_PATCHES+= ${FILESDIR}/ares-config-info.patch
+PKGNAMESUFFIX= -config
+.endif
+
USE_LDCONFIG= yes
SHLIB_VER= 1
@@ -32,6 +40,7 @@ MAN3= ares_cancel.3 \
ares_fds.3 \
ares_free_hostent.3 ares_free_string.3 \
ares_gethostbyaddr.3 ares_gethostbyname.3 ares_getnameinfo.3 \
+ ares_getsock.3 \
ares_init.3 ares_init_options.3 \
ares_mkquery.3 \
ares_parse_a_reply.3 ares_parse_aaaa_reply.3 ares_parse_ptr_reply.3 \
@@ -43,4 +52,4 @@ MAN3= ares_cancel.3 \
ares_timeout.3 \
ares_version.3
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/dns/c-ares/distinfo b/dns/c-ares/distinfo
index cb15c118c7ed..e8dd31a2b6ec 100644
--- a/dns/c-ares/distinfo
+++ b/dns/c-ares/distinfo
@@ -1,3 +1,3 @@
-MD5 (c-ares-1.3.1.tar.gz) = e79413ca62df8f124bb0dbf32119310d
-SHA256 (c-ares-1.3.1.tar.gz) = e5ac3b76534a6e0302ce9a883ee5021d84394d3e037bcef307301c85621b8580
-SIZE (c-ares-1.3.1.tar.gz) = 318859
+MD5 (c-ares-1.3.2.tar.gz) = 3f517655f22531889b2465219f4833fa
+SHA256 (c-ares-1.3.2.tar.gz) = 91d25e1b819f63043df6d81eb58efccbc90fc0ab4d9f960f4ff9953971c42aa6
+SIZE (c-ares-1.3.2.tar.gz) = 330752
diff --git a/dns/c-ares/files/ares-config-info.patch b/dns/c-ares/files/ares-config-info.patch
new file mode 100644
index 000000000000..f5b8e0d91604
--- /dev/null
+++ b/dns/c-ares/files/ares-config-info.patch
@@ -0,0 +1,54 @@
+diff -urN -x .svn ../c-ares-stock-1.3.2/ares.h ./ares.h
+--- ../c-ares-stock-1.3.2/ares.h Wed Dec 6 11:28:12 2006
++++ ./ares.h Wed Dec 6 11:49:07 2006
+@@ -164,6 +164,14 @@
+ void *sock_state_cb_data;
+ };
+
++/** Public available config (readonly) interface for ares_get_config(). */
++struct ares_config_info {
++ int timeout;
++ int tries;
++ int numservers;
++ char **servers;
++};
++
+ struct hostent;
+ struct timeval;
+ struct sockaddr;
+@@ -216,7 +224,7 @@
+ void ares_free_string(void *str);
+ void ares_free_hostent(struct hostent *host);
+ const char *ares_strerror(int code);
+-
++int ares_get_config(struct ares_config_info *d, ares_channel c);
+ #ifdef __cplusplus
+ }
+ #endif
+diff -urN -x .svn ../c-ares-stock-1.3.2/ares_init.c ./ares_init.c
+--- ../c-ares-stock-1.3.2/ares_init.c Wed Dec 6 11:28:12 2006
++++ ./ares_init.c Wed Dec 6 11:49:07 2006
+@@ -1079,3 +1079,23 @@
+ pat->mask.addr.addr4.s_addr = htonl(IN_CLASSC_NET);
+ }
+ #endif
++
++int ares_get_config(struct ares_config_info *d, ares_channel c)
++{
++int i;
++char *p;
++
++ memset(d, 0, sizeof(struct ares_config_info));
++
++ d->timeout = c->timeout;
++ d->tries = c->tries;
++ d->numservers = c->nservers;
++ d->servers = calloc(sizeof(char *), c->nservers);
++ for (i = 0; i < c->nservers; i++)
++ {
++ p = inet_ntoa(c->servers[i].addr);
++ d->servers[i] = p ? strdup(p) : NULL;
++ }
++
++ return ARES_SUCCESS;
++}