summaryrefslogtreecommitdiffstats
path: root/libc/inet/resolv.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove stale leftoversEric Andersen2004-09-071-9/+0
|
* Do not fail all lookups when /etc/resolv.conf is missing, as i.e.Eric Andersen2004-08-151-16/+7
| | | | | checking on 127.0.0.1 is still valid w/o resolv.conf -Erik
* req_search returned garbage. This teaches it to behave itself andEric Andersen2004-08-141-29/+38
| | | | | | return the length and the actual dns packet as received, rather than making stuff up. -Erik
* On Monday 02 August 2004 08:44 am, Mike Frysinger wrote:Manuel Novoa III2004-08-101-1/+16
| | | | | | | | | | | | | | | | | | | | > the gethostbyname_r() call itself is not segfaulting, but the memory > returned in the h_aliases array seems to be wrong ... was playing around with the source today and eventually the obvious answer hit me ... while read_etc_hosts_r() generatings an array of strings fo h_aliases and populates it, the dns path does not :) find attached a patch that'll actually generate the h_aliases list in the normal dns code path ... i used the etc_hosts_r() code as a template for some of it ... note that this is just a simple fix ... it fills the alias list with just the hostname gethostbyname_r was passed ... the proper fix i think would be to parse the dns packet down in __dns_lookup() and pass the info back via the resolv_answer struct ... but this fix is better than the current state of things ... that is, h_aliases currently is never initailized in the dns code path :)
* Bug fix: gethostbyname2_r would fail if /etc/host was missing.Manuel Novoa III2004-03-101-21/+38
| | | | | Bug fix: gethostbyname_r checked errno without first setting it to a known value.
* Imre Sunyi writes:Eric Andersen2004-01-241-11/+16
| | | | | | | | | | | | | | | | | | | | | Hi Erik I have corrected a bug in uClibc/libc/inet/resolv.c in function __dns_lookup(). Have attaced a txt file with my diffs regarding to uClibc 0.9.26. If two nameservers are included in /etc/resolv.conf and the first one is wrong and the secondary is correct the algorithm never looked up the secondary one. Please review my diff and feel free to submit the patch onto your CVS. If reading manual page resolv.conf(5) under nameserver and how the algorithm should work the previous dns_lookup did not fully followed that. Regards Imre Sunyi
* Implement res_search and res_querydomain based on netbsd code,Eric Andersen2004-01-041-5/+203
| | | | | | but remove support for host aliases (the HOSTALIASES env variable) which looks like a very bad idea. -Erik
* Fix a long-standing bug with pthreads. A couple of linuxthreads filesManuel Novoa III2003-12-271-6/+6
| | | | | | | | | | | | | | | | were including libc-lock.h which had a bunch of weak pragmas. Also, uClibc supplied a number of no-op weak thread functions even though many weren't needed. This combined result was that sometimes the functional versions of thread functions in pthread would not override the weaks in libc. While fixing this, I also prepended double-underscore to all necessary weak thread funcs in uClibc, and removed all unused weaks. I did a test build, but haven't tested this since these changes are a backport from my working tree. I did test the changes there and no longer need to explicitly add -lpthread in the perl build for perl to pass its thread self tests.
* We were failing to properly set h_errno on success, which couldEric Andersen2003-10-191-0/+3
| | | | | | | cause gethostbyaddr_r to keep looping allocating more and more memory each time till alloca finally caused a segfault. Ugh. This fixes that as well... -Erik
* Patch from Tony J. White:Eric Andersen2003-10-151-0/+311
| | | | | | I've created a patch for adding dn_expand() to uClibc 0.9.21. dn_expand() is used by at least ipsec-tools and also openldap I think.
* 15 retries is really rather excessive...Eric Andersen2003-09-011-1/+1
|
* Patch from Ronald Wahl fixing an IPV6 specific problemEric Andersen2003-06-171-2/+2
| | | | with getaddrinfo().
* Patch from Jeffrey Damick:Eric Andersen2003-03-011-0/+2
| | | | | | | | With glibc if you do a res_init() that forces a reread of the nameservers file, but in uClibc the res_init will not force a reread if it has already read the file because then the nameservers value is greater than 0. So res_init must call close_nameservers() before calling open_nameservers().
* Eliminate a needless externEric Andersen2003-02-121-49/+40
|
* Patch from Jay Kulpinski:Eric Andersen2003-01-101-0/+10
| | | | | | | __decode_dotted() does not count the null terminating byte of a hostname in the DNS response. This causes lookups to fail if the DNS response doesn't compress domain names in the message.
* Cleanup use of in6addr_loopback and in6addr_anyEric Andersen2002-11-211-18/+0
|
* Patch from "Cho, Seong-Myun" <smcho@xecurenexus.com> to limitEric Andersen2002-11-031-1/+3
| | | | things to the lower 16 bits of 'id'.
* Fixup struct _res handling so apps using struct _res can actuallyEric Andersen2002-08-191-11/+2
| | | | | compile ("worst standard ever!") -Erik
* Fixed __read_etc_hosts_r to return alias list and modified bufferManuel Novoa III2002-08-171-7/+26
| | | | | allocation accordingly. This fixes the segfault in the Python 2.2.1 socket test.
* Remove __res_state function.Miles Bader2002-08-161-12/+0
|
* Fixup the last missing pieces of thread lockingEric Andersen2002-08-061-22/+80
| | | | -Erik
* Finer grained locking in __connect_dns() so we don't hold theEric Andersen2002-07-081-6/+19
| | | | | lock while sending packets out onto the wire. -Erik
* Doh! search-n-replace strikes againEric Andersen2002-07-071-4/+4
| | | | -Erik
* Cleanup namespace leaks by prepending __ to global stuff toEric Andersen2002-07-071-115/+116
| | | | | indicate it is (alledgedly) private. -Erik
* Patch from Larry Doolittle <ldoolitt@recycle.lbl.gov> to cleanupEric Andersen2002-07-071-44/+46
| | | | | connect_dns() and simplify IPV6 support by reducing the number of ifdefs sprinkled about.
* Fix DNS resolution so that it once again works. I'd broken itEric Andersen2002-06-201-5/+22
| | | | | when adding some locking code. -Erik
* Make things more re-entrany, kill some cruft.Eric Andersen2002-06-171-178/+48
| | | | -Erik
* Patch from Axel Barnitzke <barney@xkontor.com> to add basicEric Andersen2002-04-171-0/+66
| | | | | support for struct _res. This is a minimalist implementation, but should work for most anything out there.
* Patch from Mike McDonald to make gethostbyname_r() not fail for things likeEric Andersen2002-04-171-0/+5
| | | | | gethostbyname("192.168.0.1"), which should work even when the /etc/hosts and /etc/config/hosts files do not exist.
* Patch from Jim Treadway <jim@stardot-tech.com> to eliminateEric Andersen2002-04-031-22/+12
| | | | | use of alarm() and therefore SIGARLM in the resolver and to instead use select, which is much cleaner.
* Patch from Bart Visscher <magick@Linux-Fan.com> fixing someEric Andersen2002-03-201-1/+3
| | | | missing pieces of the conversion to reentrant functions.
* Bart Visscher <magick@Linux-Fan.com> has added some missing IPV6 support, andEric Andersen2002-03-191-280/+558
| | | | | added several additional reentrant networking functions such that iptables now runs with IPV6 support.
* A few more little cleanupsEric Andersen2002-02-261-1/+1
|
* Thomas Fritzsche noticed that __open_etc_hosts was only changing aEric Andersen2002-02-261-6/+6
| | | | | | local copy of the FILE pointer, thereby causing /etc/hosts lookups to fail with Resolver errors. This patch from Thomas fixes the problem.
* I just wrote up gethostent(), sethostent(), and endhostent()Eric Andersen2002-02-021-11/+84
| | | | -Erik
* patch from Jari Korva <jpkorva@iki.fi>:Eric Andersen2001-12-071-6/+11
| | | | | | | | - fixes endianness bug in gethostbyaddr() (i386 worked fine, while m68k didn't: 192.168.160.162 was queried with 192.168.160.162.in-addr.arpa while it should have been 162.160.168.192.ip-addr.arpa) - contains missing pieces from my previous getnameinfo() patch: now it actually compiles!
* Adjust naming for __FORCE_GLIBC__ to __FORCE_GLIBC and addEric Andersen2001-11-211-1/+1
| | | | | support for __FORCE_NOGLIBC per Brian Stafford <brian.stafford@office-logic.com>
* Patch from Jari Korva <jpkorva@iki.fi>Eric Andersen2001-11-071-44/+300
| | | | | | | | | | | | | | | | | | | | | | I found some support in uClibc for IPv6 but I needed some more... Enclosed is the patch containing following modifications: - getnameinfo port from lates glibc - IPv6 support for gethostbyaddr() - IPv6 support for get_hosts_byname and read_etc_hosts (among other things this fixed a bug in gethostbyname2 in a case when user asked for an IPv6 but got a v4 address if it was present in /etc/hosts) - defined ip6addr_any and in6addr_loopback (though the place where I defined these isn't correct, I guess) What is still missing: - getaddrinfo (this could be ported also from glibc but it won't be as easy as porting getnameinfo, I guess) I have tested the patch using enclosed test program and boa web server. Seems to work ;)
* Patch from Jari Korva <jari.korva@vtt.fi> to fix a memory leakEric Andersen2001-11-051-0/+1
| | | | in dns_lookup.
* Yet more minor cleanupsEric Andersen2001-10-041-2/+2
|
* Update to accomodate the header file changesEric Andersen2001-09-271-3/+42
|
* A patch from Michal Moskal <malekith@pld.org.pl> to includeEric Andersen2001-07-091-0/+142
| | | | | partial IPV6 support. This adds things like gethostbyname2(). Off by defaut, of course,
* Cleanup some stupid warningsEric Andersen2001-05-311-8/+15
|
* Added /etc/hosts processing (parses everytime like a real one :-)David McCullough2001-02-261-31/+230
| | | | | | | | | | | | Added support for multiple nameserver lines, still supports multiple servers on a on single line. Added "domain" entry. domain and search are mutually exclusive and override each other (the last one wins, see the resolver(5) man page). Added dummy "getnetbyname" that returns fail. Added "res_init" and "res_query".
* Sigh. Turn debugging back off.Eric Andersen2001-02-231-1/+1
|
* This is a touch cleaner, avoids using the comma operator.Eric Andersen2001-02-231-2/+3
|
* This actually fixes things I believe.Eric Andersen2001-02-231-21/+21
|
* Fix two bugs. First, gethostbyname was doing dns queries when given an IPEric Andersen2001-02-231-3/+16
| | | | | | address. Secondly, when doing reverse dns lookups, it was appending the domain, even if a domain was already attached. -Erik
* Update networking includes.Eric Andersen2001-02-051-0/+3
|
* Patch from James Graves <jgraves@deltamobile.com> to better handle m68k.Eric Andersen2001-01-121-6/+12
| | | | | | Also fixes 2 very important malloc bugs! Anyone using malloc (esp mmu-less) should update and recompile. -Erik