1 Changelog for the c-ares project
9 o detection of semicolon comments in resolv.conf
10 o avoid using system's inet_net_pton affected by the WLB-2008080064 advisory
11 o replacement ares_inet_net_pton affected by the WLB-2008080064 advisory
13 Version 1.7.4 (December 9, 2010)
17 o local-bind: Support binding to local interface/IPs, see
18 ares_set_local_ip4, ares_set_local_ip6, ares_set_local_dev
22 o memory leak in ares_getnameinfo
23 o add missing break that caused get_ares_servers to fail
24 o ares_parse_a_reply: fix CNAME response parsing
25 o init_by_options: don't copy an empty sortlist
26 o Replaced uint32_t with unsigned int to fix broken builds
27 on a couple of platforms
28 o Fix lookup with HOSTALIASES set
29 o adig: fix NAPTR parsing
30 o compiler warning cleanups
32 Version 1.7.3 (June 11, 2010)
37 o now includes all files necessary to build it (1.7.2 lacked a file)
39 Version 1.7.2 (June 10, 2010)
43 o Added ares_parse_mx_reply()
47 o ares_init: Last, not first instance of domain or search should win
48 o improve alternative definition of bool
49 o fix VS2010 compiler warnings
52 Version 1.7.1 (Mar 23, 2010)
54 * May 31, 2010 (Jakub Hrozek)
55 - Use the last instance of domain/search, not the first one
57 * March 23, 2010 (Daniel Stenberg)
58 - We switched from CVS to git. See http://github.com/bagder/c-ares
60 * March 5, 2010 (Daniel Stenberg)
61 - Daniel Johnson provided fixes for building with the clang compiler.
63 * March 5, 2010 (Yang Tse)
64 - Added IPv6 name servers support. Implementation has been based on code,
65 comments and feedback provided November and December of 2008 by Daniel
66 Stenberg, Gregor Jasny, Phil Blundell and myself, December 2009 by Cedric
67 Bail, and February 2010 by Jakub Hrozek on the c-ares mailing list. On
68 March I reviewed all that, selected the best of each, and adjusted or
69 extended parts of it to make the best fit.
71 The external and visible result of all this is that two new functions are
72 added to the external API, ares_get_servers() and ares_set_servers(), which
73 becomes now the preferred way of getting and setting name servers for any
74 ares channel as these support both IPv4 and IPv6 name servers.
76 In order to not break ABI compatibility, ares_init_options() with option
77 mask ARES_OPT_SERVERS and ares_save_options() may still be used in code
78 which is intended to run on IPv4-only stacks. But remember that these
79 functions do not support IPv6 name servers. This implies that if the user
80 is capable of defining or providing an IPv6 name server, and the app is
81 using ares_init_options() or ares_save_options() at some point to handle
82 the name servers, the app will likely lose IPv6 name servers.
84 * January 28, 2010 (Daniel Stenberg)
85 - Tommie Gannert pointed out a silly bug in ares_process_fd() since it didn't
86 check for broken connections like ares_process() did. Based on that, I
87 merged the two functions into a single generic one with two front-ends.
89 * December 29, 2009 (Yang Tse)
90 - Laszlo Tamas Szabo adjusted Makefile.msvc compiler options so that where
91 run-time error checks enabling compiler option /GZ was used it is replaced
92 with equivalent /RTCsu for Visual Studio 2003 and newer versions. Option
93 /GX is replaced with equivalent /EHsc for all versions. Also fixed socket
94 data type for internal configure_socket function.
96 * December 21, 2009 (Yang Tse)
97 - Ingmar Runge noticed that Windows config-win32.h configuration file
98 did not include a definition for HAVE_CLOSESOCKET which resulted in
99 function close() being inappropriately used to close sockets.
101 Version 1.7.0 (Nov 30, 2009)
103 * November 26, 2009 (Yang Tse)
104 - Larry Lansing fixed ares_parse_srv_reply to properly parse replies
105 which might contain non-SRV answers, skipping over potential non-SRV
108 * November 23, 2009 (Yang Tse)
109 - Changed naming convention for c-ares libraries built with MSVC, details
110 and build instructions provided in README.msvc file.
112 * November 22, 2009 (Yang Tse)
113 - Jakub Hrozek fixed more function prototypes in man pages to sync them
114 with the ones declared in ares.h
116 - Jakub Hrozek renamed addrttl and addr6ttl structs to ares_addrttl and
117 ares_addr6ttl in order to prevent name space pollution, along with
118 necessary changes to code base and man pages.This change does not break
119 ABI, there is no need to recompile existing applications. But existing
120 applications using these structs with the old name will need source code
121 adjustments when recompiled using c-ares 1.7.0.
123 * November 21, 2009 (Yang Tse)
124 - Added manifest stuff to Makefile.msvc.
126 * November 20, 2009 (Yang Tse)
127 - Fixed several function prototypes in man pages that were out of sync
128 with the ones declared in ares.h. Added ares_free_data() along with
129 man page. Updated ares_parse_srv_reply() and ares_parse_txt_reply()
130 with changes from Jakub Hrozek making these now return linked lists
131 instead of arrays, and merging the ares_free_data() adjustments.
133 * November 10, 2009 (Yang Tse)
134 - Updated MSVC 6.0 project files to match settings from Makefile.msvc.
136 * November 9, 2009 (Yang Tse)
137 - Makefile.msvc is now the reference method to build c-ares and sample
138 programs with any MSVC compiler or MS Visual Studio version. If no
139 option or target are specified it builds dynamic and static c-ares
140 libraries in debug and release flavours and also builds all sample
141 programs using each of the different c-ares libraries.
143 * November 2, 2009 (Yang Tse)
144 - Renamed c-ares setup.h to ares_setup.h
146 * October 31, 2009 (Yang Tse)
147 - Symbol hiding configure options are named now --enable-symbol-hiding
148 and --disable-symbol-hiding in an attempt to make them less ambiguous.
150 * October 30, 2009 (Yang Tse)
151 - Many fixes for ares_parse_txt_reply()
153 * October 29, 2009 (Daniel Stenberg)
154 - Jakub Hrozek added ares_parse_txt_reply() for TXT parsing
156 * October 29, 2009 (Yang Tse)
157 - Updated MSVC 6.0 workspace and project files that allows building
158 dynamic and static c-ares libraries in debug and release flavours.
159 Additionally each of the three sample programs is built against
160 each of the four possible c-ares libraries, generating all this
161 a total number of 12 executables and 4 libraries.
163 * October 28, 2009 (Yang Tse)
164 - Initial step towards the ability to reduce c-ares exported symbols
165 when built as a shared library based on the 'visibility' attribute
166 for GNUC and Intel compilers and based on __global for Sun compilers,
167 taking also in account __declspec function decoration for Win32 and
170 * October 27, 2009 (Yang Tse)
171 - Fixed Pelles C Win32 target compilation issues.
173 * October 23, 2009 (Yang Tse)
174 - John Engelhart noticed an unreleased problem relative to a duplicate
175 ARES_ECANCELLED error code value and missing error code description.
177 * October 7, 2009 (Yang Tse)
178 - Overhauled ares__get_hostent() Fixing out of bounds memory overwrite
179 triggered with malformed /etc/hosts file. Improving parsing of /etc/hosts
180 file. Validating requested address family. Ensuring that failures always
181 return a NULL pointer. Adjusting header inclusions.
183 * October 6, 2009 (Yang Tse)
184 - Fix ssize_t redefinition errors on WIN64 reported by Alexey Simak.
186 * September 29, 2009 (Yang Tse)
187 - Make configure script also check if _REENTRANT definition is required to
188 make errno available as a preprocessor macro.
190 * September 7, 2009 (Yang Tse)
191 - Add T_SRV portability check to ares_parse_srv_reply.c
193 * 4 Sep 2009 (Daniel Stenberg)
194 - Jakub Hrozek added ares_parse_srv_reply() for SRV parsing
196 * 3 Aug 2009 (Daniel Stenberg)
197 - Joshua Kwan fixed the init routine to fill in the defaults for stuff that
198 fails to get inited by other means. This fixes a case of when the c-ares
199 init fails when internet access is fone.
201 - Timo Teras changed the reason code used in the resolve callback done when
202 ares_cancel() is used, to be ARES_ECANCELLED instead of ARES_ETIMEOUT to
203 better allow the callback to know what's happening.
205 * 14 Jul 2009 (Guenter Knauf)
206 - renamed generated config.h to ares_config.h to avoid any future clashes
207 with config.h from other projects.
209 * June 20 2009 (Yang Tse)
210 - Refactor how libraries are checked for connect() function in configure
211 script and check for connect() as it is done for other functions.
213 * June 19 2009 (Yang Tse)
214 - Make sclose() function-like macro definition used to close a socket,
215 now solely based on HAVE_CLOSESOCKET and HAVE_CLOSESOCKET_CAMEL
216 config file preprocessor definitions
218 * June 18 2009 (Yang Tse)
219 - Add CloseSocket camel case function check for configure script.
221 * June 17 2009 (Yang Tse)
222 - Check for socket() and closesocket() as it is done for other functions
225 * June 11 2009 (Yang Tse)
226 - Modified buildconf so that when automake runs it copies missing files
227 instead of symlinking them.
229 * June 8 2009 (Yang Tse)
230 - Removed buildconf.bat from release and daily snapshot archives. This
231 file is only for CVS tree checkout builds.
233 * May 26 2009 (Yang Tse)
234 - Added --enable-curldebug configure option to enable and disable building
235 with the low-level curl debug memory tracking 'feature' to allow decoupled
236 setting from --enable-debug, allowing again to build c-ares independently
239 For the c-ares library option --enable-debug enables debug build features
240 which are _not_ related with memory tracking. For the c-ares library when
241 --enable-debug is given it does not enable the memory tracking feature. If
242 you wish to enable the curl debug memory tracking you must use configure
243 option --enable-curldebug explicitily to do so.
245 Internally, definition of preprocessor symbol DEBUGBUILD restricts code
246 which is only compiled for debug enabled builds. And symbol CURLDEBUG is
247 used to differentiate code which is _only_ used for memory tracking.
249 Make ares_init(), ares_dup() and ares_init_options() fail returning
250 ARES_ENOTINITIALIZED if library initialization has not been performed
251 calling ares_library_init().
253 * May 20 2009 (Yang Tse)
254 - Added ares_library_init() and ares_library_cleanup() man pages.
256 * May 19 2009 (Yang Tse)
257 - Introduced ares_library_init() and ares_library_cleanup() functions.
259 This is an API and ABI break for Win32/64 systems. Non-Win32/64 build targets
260 using c-ares 1.7.0 can still survive without calling these functions. Read all
261 the details on ares_library_init(3) and ares_library_cleanup(3) man pages that
264 curl/libcurl 7.19.5 is fully compatible with c-ares 1.7.0 on all systems.
266 In order to use c-ares 1.7.0 with curl/libcurl on Win32/64 systems it is
267 required that curl/libcurl is 7.19.5 or newer. In other words, it is not
268 possible on Win32/64 to use c-ares 1.7.0 with a curl/libcurl version less
271 * May 11 2009 (Daniel Stenberg)
272 - Gregor Jasny made c-ares link with libtool 's -export-symbols-regex option to
273 only expose functions starting with ares_.
275 * May 7 2009 (Yang Tse)
276 - Fix an m4 overquoting triggering a spurious 'AS_TR_CPP' symbol definition
277 attempt in generated config.h
279 * May 2 2009 (Yang Tse)
280 - Use a build-time configured ares_socklen_t data type instead of socklen_t.
282 * April 21 2009 (Yang Tse)
283 - Moved potential inclusion of system's malloc.h and memory.h header files to
284 setup_once.h. Inclusion of each header file is based on the definition of
285 NEED_MALLOC_H and NEED_MEMORY_H respectively.
287 * March 11 2009 (Yang Tse)
288 - Japheth Cleaver fixed acountry.c replacing u_long with unsigned long.
290 * February 20 2009 (Yang Tse)
291 - Do not halt compilation when using VS2008 to build a Windows 2000 target.
293 * February 3 2009 (Phil Blundell)
294 - If the server returns garbage or nothing at all in response to an AAAA query,
295 go on and ask for A records anyway.
297 * January 31 2009 (Daniel Stenberg)
298 - ares_gethostbyname() now accepts 'AF_UNSPEC' as a family for resolving
299 either AF_INET6 or AF_INET. It works by accepting any of the looksups in the
300 hosts file, and it resolves the AAAA field with a fallback to A.
302 * January 14 2009 (Daniel Stenberg)
303 - ares.h no longer uses the HAVE_STRUCT_IN6_ADDR define check, but instead it
304 now declares the private struct ares_in6_addr for all systems instead of
305 relying on one possibly not present in the system.
307 * January 13 2009 (Phil Blundell)
308 - ares__send_query() now varies the retry timeout pseudo-randomly to avoid
309 packet storms when several queries were started at the same time.
311 * January 11 2009 (Daniel Stenberg)
312 - Phil Blundell added the internal function ares__expand_name_for_response()
313 that is now used by the ares_parse_*_reply() functions instead of the
314 ares_expand_name() simply to easier return ARES_EBADRESP for the cases where
315 the name expansion fails as in responses that really isn't expected.
317 Version 1.6.0 (Dec 9, 2008)
319 * December 9 2008 (Gisle Vanem)
321 Fixes for Win32 targets using the Watt-32 tcp/ip stack.
323 * Dec 4 2008 (Daniel Stenberg)
325 Gregor Jasny provided the patch that introduces ares_set_socket_callback(),
326 and I edited it to also get duped by ares_dup().
328 * Dec 3 2008 (Daniel Stenberg)
332 I made sure the public ares_config struct looks like before and yet it
333 supports the ROTATE option thanks to c-ares now storing the "optmask"
334 internally. Thus we should be ABI compatible with the past release(s)
335 now. My efforts mentioned below should not break backwards ABI compliance.
337 Here's how I suggest we proceed with the API:
339 ares_init() will be primary "channel creator" function.
341 ares_init_options() will continue to work exactly like now and before. For
342 starters, it will be the (only) way to set the existing options.
344 ares_save_options() will continue to work like today, but will ONLY save
345 options that you can set today (including ARES_OPT_ROTATE actually) but new
346 options that we add may not be saved with this.
348 Instead we introduce:
350 ares_dup() that instead can make a new channel and clone the config used
351 from an existing channel. It will then clone all config options, including
352 future new things we add.
354 ares_set_*() style functions that set (new) config options. As a start we
355 simply add these for new functionality, but over time we can also introduce
356 them for existing "struct ares_options" so that we can eventually deprecate
357 the two ares_*_options() functions.
359 ares_get_*() style functions for extracting info from a channel handle that
360 should be used instead of ares_save_options().
362 * Nov 26 2008 (Yang Tse)
363 - Brad Spencer provided changes to allow buildconf to work on OS X.
365 - Gerald Combs fixed a bug in ares_parse_ptr_reply() which would cause a
366 buffer to shrink instead of expand if a reply contained 8 or more records.
368 * Nov 25 2008 (Yang Tse)
369 - In preparation for the upcomming IPv6 nameservers patch, the internal
370 ares_addr union is now changed into an internal struct which also holds
373 * Nov 19 2008 (Daniel Stenberg)
374 - Brad Spencer brought the new function ares_gethostbyname_file() which simply
375 resolves a host name from the given file, using the regular hosts syntax.
377 * Nov 1 2008 (Daniel Stenberg)
378 - Carlo Contavalli added support for the glibc "rotate" option, as documented
381 causes round robin selection of nameservers from among those listed. This
382 has the effect of spreading the query load among all listed servers, rather
383 than having all clients try the first listed server first every time.
385 You can enable it with ARES_OPT_ROTATE
387 * Oct 21 2008 (Yang Tse)
388 Charles Hardin added handling of EINPROGRESS for UDP connects.
390 * Oct 18 2008 (Daniel Stenberg)
391 Charles Hardin made adig support a regular numerical dotted IP address for the
394 * Oct 7 2008 (Yang Tse)
395 - Added --enable-optimize configure option to enable and disable compiler
396 optimizations to allow decoupled setting from --enable-debug.
398 * Oct 2 2008 (Yang Tse)
399 - Added --enable-warnings configure option to enable and disable strict
400 compiler warnings to allow decoupled setting from --enable-debug.
402 * Sep 17 2008 (Yang Tse)
403 - Code reorganization to allow internal/private use of "nameser.h" to any
404 system that lacks arpa/nameser.h or arpa/nameser_compat.h header files.
406 * Sep 16 2008 (Yang Tse)
407 - Code reorganization to allow internal/private use of ares_writev to any
408 system that lacks the writev function.
410 * Sep 15 2008 (Yang Tse)
411 - Code reorganization to allow internal/private use of ares_strcasecmp to any
412 system that lacks the strcasecmp function.
414 - Improve configure detection of some string functions.
416 * Sep 11 2008 (Yang Tse)
417 - Code reorganization to allow internal/private use of ares_strdup to any
418 system that lacks the strdup function.
420 Version 1.5.3 (Aug 29, 2008)
422 * Aug 25 2008 (Yang Tse)
423 - Improvement by Brad House:
425 This patch addresses an issue in which a response could be sent back to the
426 source port of a client from a different address than the request was made to.
427 This is one form of a DNS cache poisoning attack.
429 The patch simply uses recvfrom() rather than recv() and validates that the
430 address returned from recvfrom() matches the address of the server we have
431 connected to. Only necessary on UDP sockets as they are connection-less, TCP
434 - Fix by George Neill:
435 Fixed compilation of acountry sample application failure on some systems.
437 * Aug 4 2008 (Daniel Stenberg)
438 - Fix by Tofu Linden:
441 * Users (usually, but not always) on 2-Wire routers and the Comcast service
442 and a wired connection to their router would find that the second and
443 subsequent DNS lookups from fresh processes using c-ares to resolve the same
444 address would cause the process to never see a reply (it keeps polling for
445 around 1m15s before giving up).
448 * On such a machine (and yeah, it took us a lot of QA to find the systems
449 that reproduce such a specific problem!), do 'ahost www.secondlife.com',
450 then do it again. The first process's lookup will work, subsequent lookups
451 will time-out and fail.
454 * init_id_key() was calling randomize_key() *before* it initialized
455 key->state, meaning that the randomness generated by randomize_key() is
456 immediately overwritten with deterministic values. (/dev/urandom was also
457 being read incorrectly in the c-ares version we were using, but this was
458 fixed in a later version.)
459 * This makes the stream of generated query-IDs from any new c-ares process
460 be an identical and predictable sequence of IDs.
461 * This makes the 2-Wire's default built-in DNS server detect these queries
462 as probable-duplicates and (erroneously) not respond at all.
465 * Aug 4 2008 (Yang Tse)
466 - Autoconf 2.62 has changed the behaviour of the AC_AIX macro which we use.
467 Prior versions of autoconf defined _ALL_SOURCE if _AIX was defined. 2.62
468 version of AC_AIX defines _ALL_SOURCE and other four preprocessor symbols
469 no matter if the system is AIX or not. To keep the traditional behaviour,
470 and an uniform one across autoconf versions AC_AIX is replaced with our
471 own internal macro CARES_CHECK_AIX_ALL_SOURCE.
473 * Aug 1 2008 (Yang Tse)
474 - Configure process now checks if the preprocessor _REENTRANT symbol is already
475 defined. If it isn't currently defined a set of checks are performed to test
476 if its definition is required to make visible to the compiler a set of *_r
477 functions. Finally, if _REENTRANT is already defined or needed it takes care
478 of making adjustments necessary to ensure that it is defined equally for the
479 configure process tests and generated config file.
481 * Jul 20 2008 (Yang Tse)
482 - When recvfrom prototype uses a void pointer for arguments 2, 5 or 6 this will
483 now cause the definition, as appropriate, of RECVFROM_TYPE_ARG2_IS_VOID,
484 RECVFROM_TYPE_ARG5_IS_VOID or RECVFROM_TYPE_ARG6_IS_VOID.
486 * Jul 17 2008 (Yang Tse)
487 - RECVFROM_TYPE_ARG2, RECVFROM_TYPE_ARG5 and RECVFROM_TYPE_ARG6 are now defined
488 to the data type pointed by its respective argument and not the pointer type.
490 * Jul 16 2008 (Yang Tse)
491 - Improved configure detection of number of arguments for getservbyport_r.
492 Detection is now based on compilation checks instead of linker ones.
494 - Configure process now checks availability of recvfrom() socket function and
495 finds out its return type and the types of its arguments. Added definitions
496 for non-configure systems config files, and introduced macro sreadfrom which
497 will be used on udp sockets as a recvfrom() wrapper in the future.
499 * Jul 15 2008 (Yang Tse)
500 - Introduce definition of _REENTRANT symbol in setup.h to improve library
501 usability. Previously the configure process only used the AC_SYS_LARGEFILE
502 macro for debug builds, now it is also used for non-debug ones enabling the
503 use of configure options --enable-largefile and --disable-largefile which
504 might be needed for library compatibility. Remove checking the size of
505 curl_off_t, it is no longer needed.
507 * Jul 3 2008 (Daniel Stenberg)
508 - Phil Blundell: If you ask ares_gethostbyname() to do an AF_INET6 lookup and
509 the target host has only A records, it automatically falls back to an
510 AF_INET lookup and gives you the A results. However, if the target host has
511 a CNAME record, this behaviour is defeated since the original query does
512 return some data even though ares_parse_aaa_reply() doesn't consider it
513 relevant. Here's a small patch to make it behave the same with and without
516 * Jul 2 2008 (Yang Tse)
517 - Fallback to gettimeofday when monotonic clock is unavailable at run-time.
519 * Jun 30 2008 (Daniel Stenberg)
521 - As was pointed out to me by Andreas Schuldei, the MAXHOSTNAMELEN define is
522 not posix or anything and thus c-ares failed to build on hurd (and possibly
523 elsewhere). The define was also somewhat artificially used in the windows
524 port. Now, I instead rewrote the use of gethostbyname to enlarge the host
525 name buffer in case of need and totally avoid the use of the MAXHOSTNAMELEN
526 define. I thus also removed the defien from the namser.h file where it was
527 once added for the windows build.
529 I also fixed init_by_defaults() function to not leak memory in case if
532 * Jun 9 2008 (Yang Tse)
534 - Make libcares.pc generated file for pkg-config include information relative
535 to the libraries needed for the static linking of c-ares.
537 * May 30 2008 (Yang Tse)
539 - Brad House fixed a missing header file inclusion in adig sample program.
541 Version 1.5.2 (May 29, 2008)
543 * May 13 2008 (Daniel Stenberg)
545 - Introducing millisecond resolution support for the timeout option. See
546 ares_init_options()'s ARES_OPT_TIMEOUTMS.
548 * May 9 2008 (Yang Tse)
550 - Use monotonic time source if available, for private function ares__tvnow()
552 * May 7 2008 (Daniel Stenberg)
554 - Sebastian made c-ares able to return all PTR-records when doing reverse
555 lookups. It is not common practice to have multiple PTR-Records for a single
556 IP, but its perfectly legal and some sites have those.
558 - Doug Goldstein provided a configure patch: updates autoconf 2.13 usage to
559 autoconf 2.57 usage (which is the version you have specified as the minimum
560 version). It's a minor change but it does clean up some warnings with newer
561 autoconf (specifically 2.62).
563 * May 5 2008 (Yang Tse)
565 - Improved parsing of resolver configuration files.
567 * April 4 2008 (Daniel Stenberg)
569 - Eino Tuominen improved the code when a file is used to seed the randomizer.
571 - Alexey Simak made adig support NAPTR records
573 - Alexey Simak fixed the VC dsp file by adding the missing source file
576 * December 11 2007 (Gisle Vanem)
578 - Added another sample application; acountry.c which converts an
579 IPv4-address(es) and/or host-name(s) to country-name and country-code.
580 This uses the service of the DNSBL at countries.nerd.dk.
582 * December 3 2007 (Daniel Stenberg)
584 - Brad Spencer fixed the configure script to assume that there's no
585 /dev/urandom when built cross-compiled as then the script cannot check for
588 - Erik Kline cleaned up ares_gethostbyaddr.c:next_lookup() somewhat
590 Version 1.5.1 (Nov 21, 2007)
592 * November 21 2007 (Daniel Stenberg)
594 - Robin Cornelius pointed out that ares_llist.h was missing in the release
597 Version 1.5.0 (Nov 21, 2007)
599 * October 2 2007 (Daniel Stenberg)
601 - ares_strerror() segfaulted if the input error number was out of the currently
604 - Yang Tse: Avoid a segfault when generating a DNS "Transaction ID" in
605 internal function init_id_key() under low memory conditions.
607 * September 28 2007 (Daniel Stenberg)
609 - Bumped version to 1.5.0 for next release and soname bumped to 2 due to ABI
610 and API changes in the progress callback (and possibly more coming up from
613 * September 28 2007 (Steinar H. Gunderson)
615 - Don't skip a server if it's the only one. (Bugfix from the Google tree.)
617 - Made the query callbacks receive the number of timeouts that happened during
618 the execution of a query, and updated documentation accordingly. (Patch from
621 - Support a few more socket options: ARES_OPT_SOCK_SNDBUF and
624 - Always register for TCP events even if there are no outstanding queries, as
625 the other side could always close the connection, which is a valid event
626 which should be responded to.
628 * September 22 2007 (Daniel Stenberg)
630 - Steinar H. Gunderson fixed: Correctly clear sockets from the fd_set on in
631 several functions (write_tcp_data, read_tcp_data, read_udp_packets) so that
632 if it fails and the socket is closed the following code doesn't try to use
635 - Steinar H. Gunderson modified c-ares to now also do to DNS retries even when
636 TCP is used since there are several edge cases where it still makes sense.
638 - Brad House provided a fix for ares_save_options():
640 Apparently I overlooked something with the ares_save_options() where it
641 would try to do a malloc(0) when no options of that type needed to be saved.
642 On most platforms, this was fine because malloc(0) doesn't actually return
643 NULL, but on AIX it does, so ares_save_options would return ARES_ENOMEM.
645 * July 14 2007 (Daniel Stenberg)
647 - Vlad Dinulescu fixed two outstanding valgrind reports:
649 1. In ares_query.c , in find_query_by_id we compare q->qid (which is a short
650 int variable) with qid, which is declared as an int variable. Moreover,
651 DNS_HEADER_SET_QID is used to set the value of qid, but DNS_HEADER_SET_QID
652 sets only the first two bytes of qid. I think that qid should be declared as
653 "unsigned short" in this function.
655 2. The same problem occurs in ares_process.c, process_answer() . query->qid
656 (an unsigned short integer variable) is compared with id, which is an
657 integer variable. Moreover, id is initialized from DNS_HEADER_QID which sets
658 only the first two bytes of id. I think that the id variable should be
659 declared as "unsigned short" in this function.
661 Even after declaring these variables as "unsigned short", the valgrind
662 errors are still there. Which brings us to the third problem.
664 3. The third problem is that Valgrind assumes that query->qid is not
665 initialised correctly. And it does that because query->qid is set from
666 DNS_HEADER_QID(qbuf); Valgrind says that qbuf has unitialised bytes. And
667 qbuf has uninitialised bytes because of channel->next_id . And next_id is
668 set by ares_init.c:ares__generate_new_id() . I found that putting short r=0
669 in this function (instead of short r) makes all Valgrind warnings go away.
670 I have studied ares__rc4() too, and this is the offending line:
672 buffer_ptr[counter] ^= state[xorIndex]; (ares_query.c:62)
674 This is what triggers Valgrind.. buffer_ptr is unitialised in this function,
675 and by applying ^= on it, it remains unitialised.
677 Version 1.4.0 (June 8, 2007)
679 * June 4 2007 (Daniel Stenberg)
681 - James Bursa reported a major memory problem when resolving multi-IP names
682 and I found and fixed the problem. It was added by Ashish Sharma's patch
685 When I then tried to verify multiple entries in /etc/hosts after my fix, I
686 got another segfault and decided this code was not ripe for inclusion and I
691 - Brad Spencer found and fixed three flaws in the code, found with the new
692 gcc 4.2.0 warning: -Waddress
694 - Brad House fixed VS2005 compiler warnings due to time_t being 64bit.
695 He also made recent Microsoft compilers use _strdup() instead of strdup().
697 - Brad House's man pages for ares_save_options() and ares_destroy_options()
700 - Ashish Sharma provided a patch for supporting multiple entries in the
701 /etc/hosts file. Patch edited for coding style and functionality by me
706 - Shmulik Regev brought cryptographically secure transaction IDs:
708 The c-ares library implementation uses a DNS "Transaction ID" field that is
709 seeded with a pseudo random number (based on gettimeofday) which is
710 incremented (++) between consecutive calls and is therefore rather
711 predictable. In general, predictability of DNS Transaction ID is a well
712 known security problem (e.g.
713 http://bak.spc.org/dms/archive/dns_id_attack.txt) and makes a c-ares based
714 implementation vulnerable to DNS poisoning. Credit goes to Amit Klein
715 (Trusteer) for identifying this problem.
717 The patch I wrote changes the implementation to use a more secure way of
718 generating unique IDs. It starts by obtaining a key with reasonable entropy
719 which is used with an RC4 stream to generate the cryptographically secure
722 Note that the key generation code (in ares_init:randomize_key) has two
723 versions, the Windows specific one uses a cryptographically safe function
724 provided (but undocumented :) by the operating system (described at
725 http://blogs.msdn.com/michael_howard/archive/2005/01/14/353379.aspx). The
726 default implementation is a bit naive and uses the standard 'rand'
727 function. Surely a better way to generate random keys exists for other
730 The patch can be tested by using the adig utility and using the '-s' option.
732 - Brad House added ares_save_options() and ares_destroy_options() that can be
733 used to keep options for later re-usal when ares_init_options() is used.
735 Problem: Calling ares_init() for each lookup can be unnecessarily resource
736 intensive. On windows, it must LoadLibrary() or search the registry
737 on each call to ares_init(). On unix, it must read and parse
738 multiple files to obtain the necessary configuration information. In
739 a single-threaded environment, it would make sense to only
740 ares_init() once, but in a heavily multi-threaded environment, it is
741 undesirable to ares_init() and ares_destroy() for each thread created
744 Solution: Create ares_save_options() and ares_destroy_options() functions to
745 retrieve and free options obtained from an initialized channel. The
746 options populated can be used to pass back into ares_init_options(),
747 it should populate all needed fields and not retrieve any information
748 from the system. Probably wise to destroy the cache every minute or
749 so to prevent the data from becoming stale.
751 - Daniel S added ares_process_fd() to allow applications to ask for processing
752 on specific sockets and thus avoiding select() and associated
753 functions/macros. This function will be used by upcoming libcurl releases
754 for this very reason. It also made me export the ares_socket_t type in the
755 public ares.h header file, since ares_process_fd() uses that type for two of
760 - Ravi Pratap fixed a flaw in the init_by_resolv_conf() function for windows
761 that could cause it to return a bad return code.
765 - Yang Tse: Provide ares_getopt() command-line parser function as a source
766 code helper function, not belonging to the actual c-ares library.
770 - Vlad Dinulescu added ares_parse_ns_reply().
774 - Yang Tse: Fix failure to get the search sequence of /etc/hosts and
775 DNS from /etc/nsswitch.conf, /etc/host.conf or /etc/svc.conf when
776 /etc/resolv.conf did not exist or was unable to read it.
780 - Install ares_dns.h too
782 - Michael Wallner fixed this problem: When I set domains in the options
783 struct, and there are domain/search entries in /etc/resolv.conf, the domains
784 of the options struct will be overridden.
788 - Yang Tse removed a couple of potential zero size memory allocations.
790 - Andreas Rieke fixed the line endings in the areslib.dsp file that I (Daniel)
791 broke in the 1.3.2 release. We should switch to a system where that file is
792 auto-generated. We could rip some code for that from curl...
794 Version 1.3.2 (November 3, 2006)
798 - Prevent ares_getsock() to overflow if more than 16 sockets are used.
802 - Guilherme Balena Versiani: I noted a strange BUG in Win32 port
803 (ares_init.c/get_iphlpapi_dns_info() function): when I disable the network
804 by hand or disconnect the network cable in Windows 2000 or Windows XP, my
805 application gets 127.0.0.1 as the only name server. The problem comes from
806 'GetNetworkParams' function, that returns the empty string "" as the only
807 name server in that case. Moreover, the Windows implementation of
808 inet_addr() returns INADDR_LOOPBACK instead of INADDR_NONE.
814 o made ares_version.h use extern "C" for c++ compilers
815 o fixed compiler warnings in ares_getnameinfo.c
816 o fixed a buffer position init for TCP reads
820 - Ravi Pratap fixed ares_getsock() to actually return the proper bitmap and
823 Version 1.3.1 (June 24, 2006)
827 - Gisle Vanem added getopt() to the ahost program. Currently accepts
828 only [-t {a|aaaa}] to specify address family in ares_gethostbyname().
832 - (wahern) Removed "big endian" DNS section and RR data integer parser
833 macros from ares_dns.h, which break c-ares on my Sparc64. Bit-wise
834 operations in C operate on logical values. And in any event the octets are
835 already in big-endian (aka network) byte order so they're being reversed
836 (thus the source of the breakage).
840 - William Ahern handles EAGAIN/EWOULDBLOCK errors in most of the I/O calls
843 TODO: Handle one last EAGAIN for a UDP socket send(2) in
848 - Bram Matthys brought my attention to a libtool peculiarity where detecting
849 things such as C++ compiler actually is a bad thing and since we don't need
850 that detection I added a work-around, much inspired by a previous patch by
851 Paolo Bonzini. This also shortens the configure script quite a lot.
855 - Nick Mathewson added the ARES_OPT_SOCK_STATE_CB option that when set makes
856 c-ares call a callback on socket state changes. A better way than the
857 ares_getsock() to get full control over the socket state.
861 - Alexander Lazic improved the getservbyport_r() configure check.
865 - Alexander Lazic pointed out that the buildconf should use the ACLOCAL_FLAGS
866 variable for easier controlling what it does and how it runs.
870 - James Bursa fixed c-ares to find the hosts file on RISC OS, and made it
871 build with newer gcc versions that no longer defines "riscos".
875 - Daniel Stenberg added ares_getsock() that extracts the set of sockets to
876 wait for action on. Similar to ares_fds() but not restricted to using
877 select() for the waiting.
881 - Yang Tse fixed some send() / recv() compiler warnings
885 - Added constants that will be used by ares_getaddrinfo
887 - Made ares_getnameinfo use the reentrant getservbyport (getservbyport_r) if it
888 is available to ensure it works properly in a threaded environment.
892 - configure fix for detecting a member in the sockaddr_in6 struct which failed
893 on ipv6-enabled HP-UX 11.00
895 Version 1.3.0 (August 29, 2005)
899 - Alfredo Tupone provided a fix for the Windows code in get_iphlpapi_dns_info()
900 when getting the DNS server etc.
904 - Added some checks for the addrinfo structure.
910 Make UDP sockets non-blocking. I've confirmed that at least on Linux 2.4 a
911 read event can come back from poll() on a valid SOCK_DGRAM socket but
912 recv(2) will still block. This patch doesn't ignore EAGAIN in
913 read_udp_packets(), though maybe it should. (This patch was edited by Daniel
914 Stenberg and a new configure test was added (imported from curl's configure)
915 to properly detect what non-blocking socket approach to use.)
917 I'm not quite sure how this was happening, but I've been seeing PTR queries
918 which seem to return empty responses. At least, they were empty when calling
919 ares_expand_name() on the record. Here's a patch which guarantees to
920 NUL-terminate the expanded name. The old behavior failed to NUL-terminate if
921 len was 0, and this was causing strlen() to run past the end of the buffer
922 after calling ares_expand_name() and getting ARES_SUCCESS as the return
923 value. If q is not greater than *s then it's equal and *s is always
924 allocated with at least one byte.
928 - Added ares_getnameinfo which mimics the getnameinfo API (another feature
929 that could use testing).
933 - Added an inet_ntop function from BIND for systems that do not have it.
937 - Made sortlist support IPv6 (this can probably use some testing).
939 - Made sortlist support CIDR matching for IPv4.
943 - Added preliminary IPv6 support to ares_gethostbyname. Currently, sortlist
944 does not work with IPv6. Also provided an implementation of bitncmp from
945 BIND for systems that do not supply this function. This will be used to add
946 IPv6 support to sortlist.
948 - Made ares_gethostbyaddr support IPv6 by specifying AF_INET6 as the family.
949 The function can lookup IPv6 addresses both from files (/etc/hosts) and
954 - Tupone Alfredo fixed includes of arpa/nameser_compat.h to build fine on Mac
959 - Dominick Meglio: Provided implementations of inet_net_pton and inet_pton
960 from BIND for systems that do not include these functions.
964 - Dominick Meglio added ares_parse_aaaa_reply.c and did various
965 adjustments. The first little steps towards IPv6 support!
969 - Fixed the VC project and makefile to use ares_cancel and ares_version
973 - The released ares_version.h from 1.2.1 says 1.2.0 due to a maketgz flaw.
976 Version 1.2.1 (October 20, 2004)
980 - Henrik Stoerner fix: got a report that Tru64 Unix (the unix from Digital
981 when they made Alpha's) uses /etc/svc.conf for the purpose fixed below for
982 other OSes. He made c-ares check for and understand it if present.
984 - Now c-ares will use local host name lookup _before_ DNS resolving by default
985 if nothing else is told.
989 - Henrik Stoerner: found out that c-ares does not look at the /etc/host.conf
990 file to determine the sequence in which to search /etc/hosts and DNS. So on
991 systems where this order is defined by /etc/host.conf instead of a "lookup"
992 entry in /etc/resolv.conf, c-ares will always default to looking in DNS
993 first, and /etc/hosts second.
997 1) resolv.conf (for the "lookup" line);
998 2) nsswitch.fon (for the "hosts:" line);
999 3) host.conf (for the "order" line).
1003 - Dominick Meglio patched: C-ares on Windows assumed that the HOSTS file is
1004 located in a static location. It assumed
1005 C:\Windows\System32\Drivers\Etc. This is a poor assumption to make. In fact,
1006 the location of the HOSTS file can be changed via a registry setting.
1008 There is a key called DatabasePath which specifies the path to the HOSTS
1010 http://www.microsoft.com/technet/itsolutions/network/deploy/depovg/tcpip2k.mspx
1012 The patch will make c-ares correctly consult the registry for the location
1017 - Gisle Vanem fixed the MSVC build files.
1021 - Gisle Vanem made c-ares build and work with his Watt-32 TCP/IP stack.
1025 - Harshal Pradhan made a minor syntax change in ares_init.c to make it build
1030 - Made the lib get built static only if --enable-debug is used.
1032 - Gisle Vanem fixed:
1034 Basically in loops like handle_errors(), 'query->next' was assigned a local
1035 variable and then query was referenced after the memory was freed by
1036 next_server(). I've changed that so next_server() and end_query() returns
1037 the next query. So callers should use this ret-value.
1039 The next problem was that 'server->tcp_buffer_pos' had a random value at
1040 entry to 1st recv() (luckily causing Winsock to return ENOBUFS).
1042 I've also added a ares_writev() for Windows to streamline the code a bit
1046 - Fixed a few variable return types for some system calls. Made configure
1047 check for ssize_t to make it possible to use that when receiving the send()
1048 error code. This is necessary to prevent compiler warnings on some systems.
1050 - Made configure create config.h, and all source files now include setup.h that
1051 might include the proper config.h (or a handicrafted alternative).
1053 - Switched to 'ares_socket_t' type for sockets in ares, since Windows don't
1056 - automake-ified and libool-ified c-ares. Now it builds libcares as a shared
1057 lib on most platforms if wanted. (This bloated the size of the release
1058 archive with another 200K!)
1060 - Makefile.am now uses Makefile.inc for the c sources, h headers and man
1061 pages, to make it easier for other makefiles to use the exact same set of
1064 - Adjusted 'maketgz' to use the new automake magic when building distribution
1067 - Anyone desires HTML and/or PDF versions of the man pages in the release
1071 - Günter Knauf made c-ares build and run on Novell Netware.
1074 - Gisle Vanem provided Makefile.dj to build with djgpp, added a few more djgpp
1075 fixes and made ares not use 'errno' to provide further info on Windows.
1078 - Gisle Vanem made it build with djgpp and run fine with the Watt-32 stack.
1081 - Gisle Vanem's init patch for Windows:
1083 The init_by_resolv_conf() function fetches the DNS-server(s)
1084 from a series of registry branches.
1086 This can be wrong in the case where DHCP has assigned nameservers, but the
1087 user has overridden these servers with other prefered settings. Then it's
1088 wrong to use the DHCPNAMESERVER setting in registry.
1090 In the case of no global DHCP-assigned or fixed servers, but DNS server(s)
1091 per adapter, one has to query the adapter branches. But how can c-ares know
1092 which adapter is valid for use? AFAICS it can't. There could be one adapter
1093 that is down (e.g. a VPN adapter).
1095 So it's better to leave this to the IP Helper API (iphlapi) available in
1096 Win-98/2000 and later. My patch falls-back to the old way if not available.
1099 - James Bursa fixed an init issue for RISC OS.
1102 - Nico Stappenbelt reported that when processing domain and search lines in
1103 the resolv.conf file, the first entry encountered is processed and used as
1104 the search list. According to the manual pages for both Linux, Solaris and
1105 Tru64, the last entry of either a domain or a search field is used.
1107 This is now adjusted in the code
1109 Version 1.2.0 (April 13, 2004)
1112 - Updated various man pages to look nicer when converted to HTML on the web
1116 - Dirk Manske provided a new function that is now named ares_cancel(). It is
1117 used to cancel/cleanup a resolve/request made using ares functions on the
1118 given ares channel. It does not destroy/kill the ares channel itself.
1120 - Dominick Meglio cleaned up the formatting in several man pages.
1123 - Dominick Meglio's new ares_expand_string. A helper function when decoding
1124 incoming DNS packages.
1126 - Daniel Stenberg modified the Makefile.in to use a for loop for the man page
1127 installation to improve overview and make it easier to add man pages.
1129 Version 1.1.0 (March 11, 2004)
1132 - Gisle Vanem improved build on Windows.
1135 - Dan Fandrich found a flaw in the Feb 22 fix.
1137 - Added better configure --enable-debug logic (taken from the curl configure
1138 script). Added acinclude.m4 to the tarball.
1141 - Removed ares_free_errmem(), the function, the file and the man page. It was
1142 not used and it did nothing.
1144 - Fixed a lot of code that wasn't "64bit clean" and thus caused a lot of
1145 compiler warnings on picky compilers.
1148 - Dominick Meglio made ares init support multiple name servers in the
1149 NameServer key on Windows.
1152 - Modified ares_private.h to include libcurl's memory debug header if
1153 CURLDEBUG is set. This makes all the ares-functions supervised properly by
1154 the curl test suite. This also forced me to add inclusion of the
1155 ares_private.h header in a few more files that are using some kind of
1156 memory-related resources.
1158 - Made the makefile only build ahost and adig if 'make demos' is used.
1161 - Dirk Manske made ares_version.h installed with 'make install'
1164 - ares_free_errmem() is subject for removal, it is simply present for future
1165 purposes, and since we removed the extra parameter in strerror() it won't
1167 - configure --enable-debug now enables picky compiler options if gcc is used
1168 - fixed several compiler warnings --enable-debug showed and Joerg Mueller-Tolk
1171 Version 1.0.0 (February 3, 2004)
1174 - now we produce the libcares.a library instead of the previous libares.a
1175 since we are no longer compatible
1179 - ares_strerror() has one argument less. This is the first official
1180 modification of the existing provided ares API.
1184 - Dirk Manske fixed how the socket is set non-blocking.
1188 - Dominick Meglio made the private gettimeofday() become ares_gettimeofday()
1189 instead in order to not pollute the name space and risk colliding with
1190 other libraries' versions of this function.
1192 * October 24, 2003. Daniel Stenberg
1194 Added ares_version().
1196 Version 1.0-pre1 (8 October 2003)
1198 - James Bursa made it run on RISC OS
1200 - Dominick Meglio made it run fine on NT4
1202 - Duncan Wilcox made it work fine on Mac OS X
1204 - Daniel Stenberg adjusted the windows port
1206 - liren at vivisimo.com made the initial windows port
1208 * Imported the sources from ares 1.1.1