and we start on 1.5.2!
[platform/upstream/c-ares.git] / CHANGES
1   Changelog for the c-ares project
2
3 Version 1.5.1 (Nov 21, 2007)
4
5 * November 21 2007 (Daniel Stenberg)
6
7 - Robin Cornelius pointed out that ares_llist.h was missing in the release
8   archive for 1.5.0
9
10 Version 1.5.0 (Nov 21, 2007)
11
12 * October 2 2007 (Daniel Stenberg)
13
14 - ares_strerror() segfaulted if the input error number was out of the currently
15   supported range.
16
17 - Yang Tse: Avoid a segfault when generating a DNS "Transaction ID" in
18   internal function init_id_key() under low memory conditions.
19
20 * September 28 2007 (Daniel Stenberg)
21
22 - Bumped version to 1.5.0 for next release and soname bumped to 2 due to ABI
23   and API changes in the progress callback (and possibly more coming up from
24   Steinar)
25
26 * September 28 2007 (Steinar H. Gunderson)
27
28 - Don't skip a server if it's the only one. (Bugfix from the Google tree.)
29
30 - Made the query callbacks receive the number of timeouts that happened during
31   the execution of a query, and updated documentation accordingly. (Patch from
32   the Google tree.)
33
34 - Support a few more socket options: ARES_OPT_SOCK_SNDBUF and
35   ARES_OPT_SOCK_RCVBUF
36
37 - Always register for TCP events even if there are no outstanding queries, as
38   the other side could always close the connection, which is a valid event
39   which should be responded to.
40
41 * September 22 2007 (Daniel Stenberg)
42
43 - Steinar H. Gunderson fixed: Correctly clear sockets from the fd_set on in
44   several functions (write_tcp_data, read_tcp_data, read_udp_packets) so that
45   if it fails and the socket is closed the following code doesn't try to use
46   the file descriptor.
47
48 - Steinar H. Gunderson modified c-ares to now also do to DNS retries even when
49   TCP is used since there are several edge cases where it still makes sense.
50
51 - Brad House provided a fix for ares_save_options():
52
53   Apparently I overlooked something with the ares_save_options() where it
54   would try to do a malloc(0) when no options of that type needed to be saved.
55   On most platforms, this was fine because malloc(0) doesn't actually return
56   NULL, but on AIX it does, so ares_save_options would return ARES_ENOMEM.
57
58 * July 14 2007 (Daniel Stenberg)
59
60 - Vlad Dinulescu fixed two outstanding valgrind reports:
61  
62   1. In ares_query.c , in find_query_by_id we compare q->qid (which is a short
63   int variable) with qid, which is declared as an int variable.  Moreover,
64   DNS_HEADER_SET_QID is used to set the value of qid, but DNS_HEADER_SET_QID
65   sets only the first two bytes of qid. I think that qid should be declared as
66   "unsigned short" in this function.
67
68   2. The same problem occurs in ares_process.c, process_answer() .  query->qid
69   (an unsigned short integer variable) is compared with id, which is an
70   integer variable. Moreover, id is initialized from DNS_HEADER_QID which sets
71   only the first two bytes of id. I think that the id variable should be
72   declared as "unsigned short" in this function.
73
74   Even after declaring these variables as "unsigned short", the valgrind
75   errors are still there. Which brings us to the third problem.
76
77   3. The third problem is that Valgrind assumes that query->qid is not
78   initialised correctly. And it does that because query->qid is set from
79   DNS_HEADER_QID(qbuf); Valgrind says that qbuf has unitialised bytes. And
80   qbuf has uninitialised bytes because of channel->next_id . And next_id is
81   set by ares_init.c:ares__generate_new_id() . I found that putting short r=0
82   in this function (instead of short r) makes all Valgrind warnings go away.
83   I have studied ares__rc4() too, and this is the offending line:
84
85         buffer_ptr[counter] ^= state[xorIndex];   (ares_query.c:62)
86
87   This is what triggers Valgrind.. buffer_ptr is unitialised in this function,
88   and by applying ^= on it, it remains unitialised.
89
90 Version 1.4.0 (June 8, 2007)
91
92 * June 4 2007 (Daniel Stenberg)
93
94 - James Bursa reported a major memory problem when resolving multi-IP names
95   and I found and fixed the problem. It was added by Ashish Sharma's patch
96   two days ago.
97
98   When I then tried to verify multiple entries in /etc/hosts after my fix, I
99   got another segfault and decided this code was not ripe for inclusion and I
100   reverted the patch.
101
102 * June 2 2007
103
104 - Brad Spencer found and fixed three flaws in the code, found with the new
105   gcc 4.2.0 warning: -Waddress
106
107 - Brad House fixed VS2005 compiler warnings due to time_t being 64bit.
108   He also made recent Microsoft compilers use _strdup() instead of strdup().
109
110 - Brad House's man pages for ares_save_options() and ares_destroy_options()
111   were added.
112
113 - Ashish Sharma provided a patch for supporting multiple entries in the
114   /etc/hosts file. Patch edited for coding style and functionality by me
115   (Daniel).
116
117 * May 30 2007
118
119 - Shmulik Regev brought cryptographically secure transaction IDs:
120
121   The c-ares library implementation uses a DNS "Transaction ID" field that is
122   seeded with a pseudo random number (based on gettimeofday) which is
123   incremented (++) between consecutive calls and is therefore rather
124   predictable. In general, predictability of DNS Transaction ID is a well
125   known security problem (e.g.
126   http://bak.spc.org/dms/archive/dns_id_attack.txt) and makes a c-ares based
127   implementation vulnerable to DNS poisoning. Credit goes to Amit Klein
128   (Trusteer) for identifying this problem.
129
130   The patch I wrote changes the implementation to use a more secure way of
131   generating unique IDs. It starts by obtaining a key with reasonable entropy
132   which is used with an RC4 stream to generate the cryptographically secure
133   transaction IDs.
134
135   Note that the key generation code (in ares_init:randomize_key) has two
136   versions, the Windows specific one uses a cryptographically safe function
137   provided (but undocumented :) by the operating system (described at
138   http://blogs.msdn.com/michael_howard/archive/2005/01/14/353379.aspx).  The
139   default implementation is a bit naive and uses the standard 'rand'
140   function. Surely a better way to generate random keys exists for other
141   platforms.
142
143   The patch can be tested by using the adig utility and using the '-s' option.
144
145 - Brad House added ares_save_options() and ares_destroy_options() that can be
146   used to keep options for later re-usal when ares_init_options() is used.
147   
148   Problem: Calling ares_init() for each lookup can be unnecessarily resource
149          intensive.  On windows, it must LoadLibrary() or search the registry
150          on each call to ares_init().  On unix, it must read and parse
151          multiple files to obtain the necessary configuration information.  In
152          a single-threaded environment, it would make sense to only
153          ares_init() once, but in a heavily multi-threaded environment, it is
154          undesirable to ares_init() and ares_destroy() for each thread created
155          and track that.
156
157   Solution: Create ares_save_options() and ares_destroy_options() functions to
158          retrieve and free options obtained from an initialized channel.  The
159          options populated can be used to pass back into ares_init_options(),
160          it should populate all needed fields and not retrieve any information
161          from the system.  Probably wise to destroy the cache every minute or
162          so to prevent the data from becoming stale.
163
164 - Daniel S added ares_process_fd() to allow applications to ask for processing
165   on specific sockets and thus avoiding select() and associated
166   functions/macros.  This function will be used by upcoming libcurl releases
167   for this very reason. It also made me export the ares_socket_t type in the
168   public ares.h header file, since ares_process_fd() uses that type for two of
169   the arguments.
170
171 * May 25 2007
172
173 - Ravi Pratap fixed a flaw in the init_by_resolv_conf() function for windows
174   that could cause it to return a bad return code.
175
176 * April 16 2007
177
178 - Yang Tse: Provide ares_getopt() command-line parser function as a source
179   code helper function, not belonging to the actual c-ares library.
180
181 * February 19 2007
182
183 - Vlad Dinulescu added ares_parse_ns_reply().
184
185 * February 13 2007
186
187 - Yang Tse: Fix failure to get the search sequence of /etc/hosts and
188   DNS from /etc/nsswitch.conf, /etc/host.conf or /etc/svc.conf when
189   /etc/resolv.conf did not exist or was unable to read it.
190
191 * November 22 2006
192
193 - Install ares_dns.h too
194
195 - Michael Wallner fixed this problem: When I set domains in the options
196   struct, and there are domain/search entries in /etc/resolv.conf, the domains
197   of the options struct will be overridden.
198
199 * November 6 2006
200
201 - Yang Tse removed a couple of potential zero size memory allocations.
202
203 - Andreas Rieke fixed the line endings in the areslib.dsp file that I (Daniel)
204   broke in the 1.3.2 release. We should switch to a system where that file is
205   auto-generated. We could rip some code for that from curl...
206
207 Version 1.3.2 (November 3, 2006)
208
209 * October 12 2006
210
211 - Prevent ares_getsock() to overflow if more than 16 sockets are used.
212
213 * September 11 2006
214
215 - Guilherme Balena Versiani: I noted a strange BUG in Win32 port
216   (ares_init.c/get_iphlpapi_dns_info() function): when I disable the network
217   by hand or disconnect the network cable in Windows 2000 or Windows XP, my
218   application gets 127.0.0.1 as the only name server. The problem comes from
219   'GetNetworkParams' function, that returns the empty string "" as the only
220   name server in that case. Moreover, the Windows implementation of
221   inet_addr() returns INADDR_LOOPBACK instead of INADDR_NONE.
222
223 * August 29 2006
224
225 - Brad Spencer did
226
227   o made ares_version.h use extern "C" for c++ compilers
228   o fixed compiler warnings in ares_getnameinfo.c
229   o fixed a buffer position init for TCP reads
230
231 * August 3 2006
232
233 - Ravi Pratap fixed ares_getsock() to actually return the proper bitmap and
234   not always zero!
235
236 Version 1.3.1 (June 24, 2006)
237
238 * July 23, 2006
239
240 - Gisle Vanem added getopt() to the ahost program. Currently accepts
241   only [-t {a|aaaa}] to specify address family in ares_gethostbyname().
242
243 * June 19, 2006
244
245 - (wahern) Removed "big endian" DNS section and RR data integer parser
246   macros from ares_dns.h, which break c-ares on my Sparc64. Bit-wise
247   operations in C operate on logical values. And in any event the octets are
248   already in big-endian (aka network) byte order so they're being reversed
249   (thus the source of the breakage).
250
251 * June 18, 2006
252
253 - William Ahern handles EAGAIN/EWOULDBLOCK errors in most of the I/O calls
254   from area_process.c.
255
256   TODO: Handle one last EAGAIN for a UDP socket send(2) in
257   ares__send_query().
258
259 * May 10, 2006
260
261 - Bram Matthys brought my attention to a libtool peculiarity where detecting
262   things such as C++ compiler actually is a bad thing and since we don't need
263   that detection I added a work-around, much inspired by a previous patch by
264   Paolo Bonzini. This also shortens the configure script quite a lot.
265
266 * May 3, 2006
267
268 - Nick Mathewson added the ARES_OPT_SOCK_STATE_CB option that when set makes
269   c-ares call a callback on socket state changes. A better way than the
270   ares_getsock() to get full control over the socket state.
271
272 * January 9, 2006
273
274 - Alexander Lazic improved the getservbyport_r() configure check.
275
276 * January 6, 2006
277
278 - Alexander Lazic pointed out that the buildconf should use the ACLOCAL_FLAGS
279   variable for easier controlling what it does and how it runs.
280
281 * January 5, 2006
282
283 - James Bursa fixed c-ares to find the hosts file on RISC OS, and made it
284   build with newer gcc versions that no longer defines "riscos".
285
286 * December 22
287
288 - Daniel Stenberg added ares_getsock() that extracts the set of sockets to
289   wait for action on. Similar to ares_fds() but not restricted to using
290   select() for the waiting.
291
292 * November 25
293
294 - Yang Tse fixed some send() / recv() compiler warnings
295
296 * September 18
297
298 - Added constants that will be used by ares_getaddrinfo
299
300 - Made ares_getnameinfo use the reentrant getservbyport (getservbyport_r) if it
301   is available to ensure it works properly in a threaded environment.
302
303 * September 10
304
305 - configure fix for detecting a member in the sockaddr_in6 struct which failed
306   on ipv6-enabled HP-UX 11.00
307
308 Version 1.3.0 (August 29, 2005)
309
310 * August 21
311
312 - Alfredo Tupone provided a fix for the Windows code in get_iphlpapi_dns_info()
313   when getting the DNS server etc.
314
315 * June 19
316
317 - Added some checks for the addrinfo structure.
318
319 * June 2
320
321 - William Ahern:
322
323   Make UDP sockets non-blocking. I've confirmed that at least on Linux 2.4 a
324   read event can come back from poll() on a valid SOCK_DGRAM socket but
325   recv(2) will still block. This patch doesn't ignore EAGAIN in
326   read_udp_packets(), though maybe it should. (This patch was edited by Daniel
327   Stenberg and a new configure test was added (imported from curl's configure)
328   to properly detect what non-blocking socket approach to use.)
329
330   I'm not quite sure how this was happening, but I've been seeing PTR queries
331   which seem to return empty responses. At least, they were empty when calling
332   ares_expand_name() on the record. Here's a patch which guarantees to
333   NUL-terminate the expanded name. The old behavior failed to NUL-terminate if
334   len was 0, and this was causing strlen() to run past the end of the buffer
335   after calling ares_expand_name() and getting ARES_SUCCESS as the return
336   value. If q is not greater than *s then it's equal and *s is always
337   allocated with at least one byte.
338
339 * May 16
340
341 - Added ares_getnameinfo which mimics the getnameinfo API (another feature
342   that could use testing).
343
344 * May 14
345
346 - Added an inet_ntop function from BIND for systems that do not have it.
347
348 * April 9
349
350 - Made sortlist support IPv6 (this can probably use some testing).
351
352 - Made sortlist support CIDR matching for IPv4.
353
354 * April 8
355
356 - Added preliminary IPv6 support to ares_gethostbyname. Currently, sortlist
357   does not work with IPv6. Also provided an implementation of bitncmp from
358   BIND for systems that do not supply this function. This will be used to add
359   IPv6 support to sortlist.
360
361 - Made ares_gethostbyaddr support IPv6 by specifying AF_INET6 as the family.
362   The function can lookup IPv6 addresses both from files (/etc/hosts) and
363   DNS lookups.
364
365 * April 7
366
367 - Tupone Alfredo fixed includes of arpa/nameser_compat.h to build fine on Mac
368   OS X.
369
370 * April 5
371
372 - Dominick Meglio: Provided implementations of inet_net_pton and inet_pton
373   from BIND for systems that do not include these functions.
374
375 * March 11, 2005
376
377 - Dominick Meglio added ares_parse_aaaa_reply.c and did various
378   adjustments. The first little steps towards IPv6 support!
379
380 * November 7
381
382 - Fixed the VC project and makefile to use ares_cancel and ares_version
383
384 * October 24
385
386 - The released ares_version.h from 1.2.1 says 1.2.0 due to a maketgz flaw.
387   This is now fixed.
388
389 Version 1.2.1 (October 20, 2004)
390
391 * September 29
392
393 - Henrik Stoerner fix: got a report that Tru64 Unix (the unix from Digital
394   when they made Alpha's) uses /etc/svc.conf for the purpose fixed below for
395   other OSes. He made c-ares check for and understand it if present.
396
397 - Now c-ares will use local host name lookup _before_ DNS resolving by default
398   if nothing else is told.
399
400 * September 26
401
402 - Henrik Stoerner: found out that c-ares does not look at the /etc/host.conf
403   file to determine the sequence in which to search /etc/hosts and DNS.  So on
404   systems where this order is defined by /etc/host.conf instead of a "lookup"
405   entry in /etc/resolv.conf, c-ares will always default to looking in DNS
406   first, and /etc/hosts second.
407
408   c-ares now looks at
409
410   1) resolv.conf (for the "lookup" line);
411   2) nsswitch.fon (for the "hosts:" line);
412   3) host.conf (for the "order" line).
413
414   First match wins.
415
416 - Dominick Meglio patched: C-ares on Windows assumed that the HOSTS file is
417   located in a static location. It assumed
418   C:\Windows\System32\Drivers\Etc. This is a poor assumption to make. In fact,
419   the location of the HOSTS file can be changed via a registry setting.
420
421   There is a key called DatabasePath which specifies the path to the HOSTS
422   file:
423   http://www.microsoft.com/technet/itsolutions/network/deploy/depovg/tcpip2k.mspx
424
425   The patch will make c-ares correctly consult the registry for the location
426   of this file.
427
428 * August 29
429
430 - Gisle Vanem fixed the MSVC build files.
431
432 * August 20
433
434 - Gisle Vanem made c-ares build and work with his Watt-32 TCP/IP stack.
435
436 * August 13
437
438 - Harshal Pradhan made a minor syntax change in ares_init.c to make it build
439   fine with MSVC 7.1
440
441 * July 24
442
443 - Made the lib get built static only if --enable-debug is used.
444
445 - Gisle Vanem fixed:
446
447   Basically in loops like handle_errors(), 'query->next' was assigned a local
448   variable and then query was referenced after the memory was freed by
449   next_server(). I've changed that so next_server() and end_query() returns
450   the next query. So callers should use this ret-value.
451
452   The next problem was that 'server->tcp_buffer_pos' had a random value at
453   entry to 1st recv() (luckily causing Winsock to return ENOBUFS).
454
455   I've also added a ares_writev() for Windows to streamline the code a bit
456   more.
457
458 * July 20
459 - Fixed a few variable return types for some system calls. Made configure
460   check for ssize_t to make it possible to use that when receiving the send()
461   error code. This is necessary to prevent compiler warnings on some systems.
462
463 - Made configure create config.h, and all source files now include setup.h that
464   might include the proper config.h (or a handicrafted alternative).
465
466 - Switched to 'ares_socket_t' type for sockets in ares, since Windows don't
467   use 'int' for that.
468
469 - automake-ified and libool-ified c-ares. Now it builds libcares as a shared
470   lib on most platforms if wanted. (This bloated the size of the release
471   archive with another 200K!)
472
473 - Makefile.am now uses Makefile.inc for the c sources, h headers and man
474   pages, to make it easier for other makefiles to use the exact same set of
475   files.
476
477 - Adjusted 'maketgz' to use the new automake magic when building distribution
478   archives.
479
480 - Anyone desires HTML and/or PDF versions of the man pages in the release
481   archives?
482
483 * July 3
484 - Günter Knauf made c-ares build and run on Novell Netware.
485
486 * July 1
487 - Gisle Vanem provided Makefile.dj to build with djgpp, added a few more djgpp
488   fixes and made ares not use 'errno' to provide further info on Windows.
489
490 * June 30
491 - Gisle Vanem made it build with djgpp and run fine with the Watt-32 stack.
492
493 * June 10
494 - Gisle Vanem's init patch for Windows:
495
496   The init_by_resolv_conf() function fetches the DNS-server(s)
497   from a series of registry branches.
498
499   This can be wrong in the case where DHCP has assigned nameservers, but the
500   user has overridden these servers with other prefered settings. Then it's
501   wrong to use the DHCPNAMESERVER setting in registry.
502
503   In the case of no global DHCP-assigned or fixed servers, but DNS server(s)
504   per adapter, one has to query the adapter branches.  But how can c-ares know
505   which adapter is valid for use? AFAICS it can't. There could be one adapter
506   that is down (e.g. a VPN adapter).
507
508   So it's better to leave this to the IP Helper API (iphlapi) available in
509   Win-98/2000 and later. My patch falls-back to the old way if not available.
510
511 * June 8
512 - James Bursa fixed an init issue for RISC OS.
513
514 * May 11
515 - Nico Stappenbelt reported that when processing domain and search lines in
516   the resolv.conf file, the first entry encountered is processed and used as
517   the search list. According to the manual pages for both Linux, Solaris and
518   Tru64, the last entry of either a domain or a search field is used.
519
520   This is now adjusted in the code
521
522 Version 1.2.0 (April 13, 2004)
523
524 * April 2, 2004
525 - Updated various man pages to look nicer when converted to HTML on the web
526   site.
527
528 * April 1, 2004
529 - Dirk Manske provided a new function that is now named ares_cancel(). It is
530   used to cancel/cleanup a resolve/request made using ares functions on the
531   given ares channel. It does not destroy/kill the ares channel itself.
532
533 - Dominick Meglio cleaned up the formatting in several man pages.
534
535 * March 30, 2004
536 - Dominick Meglio's new ares_expand_string. A helper function when decoding
537   incoming DNS packages.
538
539 - Daniel Stenberg modified the Makefile.in to use a for loop for the man page
540   installation to improve overview and make it easier to add man pages.
541
542 Version 1.1.0 (March 11, 2004)
543
544 * March 9, 2004
545 - Gisle Vanem improved build on Windows.
546
547 * February 25, 2004
548 - Dan Fandrich found a flaw in the Feb 22 fix.
549
550 - Added better configure --enable-debug logic (taken from the curl configure
551   script). Added acinclude.m4 to the tarball.
552
553 * February 23, 2004
554 - Removed ares_free_errmem(), the function, the file and the man page. It was
555   not used and it did nothing.
556
557 - Fixed a lot of code that wasn't "64bit clean" and thus caused a lot of
558   compiler warnings on picky compilers.
559
560 * February 22, 2004
561 - Dominick Meglio made ares init support multiple name servers in the
562   NameServer key on Windows.
563
564 * February 16, 2004
565 - Modified ares_private.h to include libcurl's memory debug header if
566   CURLDEBUG is set. This makes all the ares-functions supervised properly by
567   the curl test suite. This also forced me to add inclusion of the
568   ares_private.h header in a few more files that are using some kind of
569   memory-related resources.
570
571 - Made the makefile only build ahost and adig if 'make demos' is used.
572
573 * February 10, 2004
574 - Dirk Manske made ares_version.h installed with 'make install'
575
576 * February 4, 2004
577 - ares_free_errmem() is subject for removal, it is simply present for future
578   purposes, and since we removed the extra parameter in strerror() it won't
579   be used by c-ares!
580 - configure --enable-debug now enables picky compiler options if gcc is used
581 - fixed several compiler warnings --enable-debug showed and Joerg Mueller-Tolk
582   reported
583
584 Version 1.0.0 (February 3, 2004)
585
586 * February 3, 2004
587 - now we produce the libcares.a library instead of the previous libares.a
588   since we are no longer compatible
589
590 * February 2, 2004
591
592 - ares_strerror() has one argument less. This is the first official
593   modification of the existing provided ares API.
594
595 * January 29, 2004
596
597 - Dirk Manske fixed how the socket is set non-blocking.
598
599 * January 4, 2004
600
601 - Dominick Meglio made the private gettimeofday() become ares_gettimeofday()
602   instead in order to not pollute the name space and risk colliding with
603   other libraries' versions of this function.
604
605 * October 24, 2003. Daniel Stenberg
606
607   Added ares_version().
608
609 Version 1.0-pre1 (8 October 2003)
610
611 - James Bursa made it run on RISC OS
612
613 - Dominick Meglio made it run fine on NT4
614
615 - Duncan Wilcox made it work fine on Mac OS X
616
617 - Daniel Stenberg adjusted the windows port
618
619 - liren at vivisimo.com made the initial windows port
620
621 * Imported the sources from ares 1.1.1