summaryrefslogtreecommitdiffstats
path: root/libc/inet/resolv.c
Commit message (Collapse)AuthorAgeFilesLines
* check stat("/etc/resolv.conf") for errorsDenys Vlasenko2009-10-161-1/+2
| | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* libc/inet/resolv.c: reread resolv.conf if its mtime was changedBernhard Reutner-Fischer2009-10-161-6/+9
| | | | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* link-time warning for obsolescent/removed network funcsBernhard Reutner-Fischer2009-10-161-0/+4
| | | | | Signed-off-by: aldot <rep.dot.nop@gmail.com> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* add a __resp ptr for the no threads caseAustin Foxley2009-09-201-0/+1
| | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* Readd the thread local version of __res_stateAustin Foxley2009-07-101-3/+51
| | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* Sync nptl branch to masterAustin Foxley2009-07-091-1525/+2005
| | | | | | | | | | | | | | Cherry picked these commits: afdfa59588: Do not install libc-XXX.h files fb863f7592: Make HARDWIRED_ABSPATH a config option e0c8160a38: Allow people to run hostutils targets without .config e0da861a29: Don't rely on features.h ac1087a727: Denis's resolv.c cleanup Pulled out the thread local __res_state in resolv. Will reapply it in a future commit. Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* resolver:Denis Vlasenko2009-03-101-63/+7
| | | | | | | res_query: do not unconditionally set h_errno to TRY_AGAIN (closes bug 173). cleanups: s/__dn_expand/dn_expand/, remove superfluous dn_expand declaration, remove libc_hidden_proto junk
* Use __UCLIBC_HAS_TLS__ (now available) as guard for TLS relatedCarmelo Amoroso2009-02-201-2/+2
| | | | | | | | stuff, instead of __UCLIBC_HAS_THREADS_NATIVE__. This is in preparation on trunk merge to make TLS compatible with LT (new) and NPTL. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* - synch r25316:25325 from trunkBernhard Reutner-Fischer2009-02-181-0/+8
|
* Fix res_init.c build when __UCLIBC_HAS_COMPAT_RES_STATE__Carmelo Amoroso2009-01-261-1/+3
| | | | | | | is not enabled by properly guarding optional fields assignment. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* Synch with trunk: miscellaneous changes, mostly cleanup,Carmelo Amoroso2009-01-221-34/+35
| | | | | | | code styling, comments. No object-code changes. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* res_state has _vcsock field only if __UCLIBC_HAS_EXTRA_COMPAT_RES_STATE__Carmelo Amoroso2009-01-221-0/+2
| | | | | | | is enabled. FIx build problem. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* Get non nptl threads compiled on x86.Khem Raj2008-12-231-2/+2
|
* Removed some __libc_xxx fucntions as merged from trunk.Carmelo Amoroso2008-12-111-3/+3
| | | | | Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* Synch with trunk @ 24087Carmelo Amoroso2008-11-181-5/+5
| | | | Step 10: libc_hidden_removal
* Fix preprocessor directive to silent warningCarmelo Amoroso2008-07-311-1/+1
|
* Fix the builds without STDIO_FUTEXES. Fix msgecv and msgsend to compile on ↵Khem Raj2008-07-091-0/+1
| | | | ARM as well.
* BIG BIG commit: all left files merged from trunk [rev 22714]. Currenntly ↵Carmelo Amoroso2008-07-091-692/+784
| | | | NPTL sh4 port build and work fine. All committed to allow Khem Ray working on a working branch to integrate the ARM nptl port. MIPS nptl port not tested but should still building and working fine. There are some other part non yet merged with trunk (misc/internals and some headers file that need some more work). Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* Sync build machinery stuff from trunk. Some more fixed for mips nptl portKhem Raj2008-06-271-1/+0
|
* Merge from trunk and bring in NPTL changes."Steven J. Hill"2006-08-231-5/+15
|
* Merge from trunk. Going pretty good so far. Kind of. Okay, not really."Steven J. Hill"2006-02-251-163/+168
|
* Clean up '_res' such that it will now work for, NPTL, linuxthreads and"Steven J. Hill"2006-01-151-12/+16
| | | | | even no threads. Fix 'pthread_atfork' function and clean up duplicate of '__set_errno' that is not needed.
* Merge from trunk."Steven J. Hill"2006-01-141-10/+17
|
* Make resolver state pointer '__resp' to be TLS variable. Again, these ↵"Steven J. Hill"2006-01-051-33/+66
| | | | changes work for the threaded and non-threaded cases.
* Clean-up definition and usage of h_errno to be a TLS variable."Steven J. Hill"2005-12-131-1/+0
|
* Finish merge from trunk, again, no really."Steven J. Hill"2005-12-101-5/+14
|
* Replace NPTL needed code."Steven J. Hill"2005-12-081-1/+12
|
* Merge from trunk."Steven J. Hill"2005-12-081-27/+49
|
* More merging from trunk."Steven J. Hill"2005-12-061-24/+21
|
* Merge from trunk. More to come you betcha'."Steven J. Hill"2005-12-021-95/+109
|
* Merge from trunk."Steven J. Hill"2005-10-301-10/+4
|
* Rename option PTHREADS_NATIVE to be UCLIBC_HAS_THREADS_NATIVE instead. What ↵"Steven J. Hill"2005-09-241-1/+1
| | | | a stupid name to start with. What idiot thought of that?
* This will hopefully be the last modification to the resolver code for a ↵"Steven J. Hill"2005-08-121-5/+10
| | | | while. The complexity comes from the code used only during library build time, to non-threaded programs to threaded programs such that things are not a mess. I was getting undefined '_res' when doing a buildroot, but things are fixed now. This is much cleaner and more sane.
* Last of the merges along with latest changes for NPTL. Nothing much"Steven J. Hill"2005-07-301-0/+1
| | | | new on the NPTL stuff other than cleaning a few things up.
* Fixed up resolver and errno code such that both thread models can compile ↵"Steven J. Hill"2005-07-221-26/+6
| | | | without stepping on each other. The original implementation pulled from glibc was done incorrectly and has been fixed.
* Update structures and defines necessary to make resolver code thread"Steven J. Hill"2005-06-031-0/+25
| | | | | | safe for TLS and NPTL. Our name resolver code is so out of date, we made not be able to correctly utilize it in multi-threaded programs compiled with NPTL.
* The default static buffer sizes are too small to handle the 8 entries returnedEric Andersen2005-05-101-5/+5
| | | | | | | | | | | by 'nslookup www.yahoo.com' and 'nslookup mail.hotmail.com', and thus we currently return ERANGE when trying to lookup some of the most popular hosts on the planet. Whether these sites deserve to be popular is a question I'll leave for someone else to worry about. This change makes certain we have enough static buffer space to handle about 21 IPv4 IP address replies per DNS query. Far more than enough to handle common cases such as www.yahoo.com and mail.hotmail.com.
* Fix it so uClibc returns multiple ips via h_addr_list,Eric Andersen2005-04-281-66/+117
| | | | | | | | | | | | | | | | | | | | | | | | | This fix, based on this patch http://bugs.uclibc.org/view.php?id=104 makes it so uClibc fills out round robin dns lists for applications such as nslookup: Before: $ nslookup google.com Server: mace.codepoet.org Address: 10.10.10.1 Name: google.com Address: 216.239.39.99 After: $ nslookup google.com Server: mace.codepoet.org Address: 10.10.10.1 Name: google.com Addresses: 216.239.57.99, 216.239.37.99, 216.239.39.99
* Cleanup error case a bitEric Andersen2005-04-281-8/+8
|
* This might actually now be thread safe, assuming I havn't broken it.Eric Andersen2005-04-281-20/+27
|
* trim trailing whitespaceEric Andersen2005-04-281-26/+26
|
* Jan Lana writes:Eric Andersen2005-01-111-11/+12
| | | | | | | | | | | | | | | | | | | | uClibc resolver doesn't lookup all search domains. For example, if you have computer 'jenda.prague.my.cz' and resolv.conf: search my.cz nameserver xx.xx.xx.xx try this: ping jenda.prague.my.cz #works ping jenda.prague #unknown host libc/inet/resolv.c doesn't want to try search domains if the domain name contains '.'. I don't find any reason for the behaviour in literature and it is inconsistent with the glibc. Patch is attached. regards, - jenda
* Implement gethostent_rEric Andersen2004-09-071-15/+31
|
* 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