summaryrefslogtreecommitdiff
path: root/libc/inet/resolv.c
AgeCommit message (Collapse)Author
2007-09-28This patch will fix a problem when the same host is defined with both IPv4 andMike Frysinger
IPv6 entries in /etc/hosts. Previous only the first of these host would work, as uClibc would read the /etc/hosts file from top to bottom, failing if the first hit did not match the IP type. Now uClibc will continue reading, even if the first correct entry name, but wrong IP type fails. Thus, allowing a second correct entry name with correct IP type will result in a name resolve. Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
2007-09-28do not check the pointer before freeing it since free(NULL) works just fineMike Frysinger
2007-09-28cleanup code styleMike Frysinger
2007-07-30patch #3: make resolv.c use __uc_mallocDenis Vlasenko
2007-04-23- include stdbool.hBernhard Reutner-Fischer
2007-04-17- shrink resolver codeBernhard Reutner-Fischer
2007-03-28Warning fix for uninitialized variable, by Al Stone.Rob Landley
2007-02-02Ronald Maeder writes:Eric Andersen
I have successfully made gethostbyname_r(), res_init(), and gethostid() fully reentrant. In addition, I have added a NULL check to inet_aton(). This is where SEG FAULTs were coming from when gethostbyname_r() was called.
2007-02-02use the correct lock for access to __nameserver[]Eric Andersen
2007-02-02fix lock namingEric Andersen
2007-02-02Ronald Maeder writes:Eric Andersen
Hi Erik, Thanks for all your great work. I found a set of bugs in resolv.c . Basically, there is code that looks like: BIGLOCK; __nameserversXX=__nameservers; __nameserverXX=__nameserver; BIGUNLOCK; i = __dns_lookup(dname, type, __nameserversXX, __nameserverXX, &packet, &a); which is a problem because the declarations are int __nameservers; char * __nameserver[MAX_SERVERS]; int __searchdomains; char * __searchdomain[MAX_SEARCH]; so you can see that __nameserver is a pointer. Copying the pointer to __nameserverXX doesn't protect the global variable space. I have attached a patch and the new file. I hope you will incorporate these bug fixes. I spent quite a bit of time tracking them down. Many thanks, Ron
2007-02-02fix obvious bug in ipv4/ipv6 resolving. When not using AF_INET,Eric Andersen
gethostbyname2_r tries to resolve an ipv6 address from /etc/hosts using get_hosts_byname_r, but with AF_INET instead of the supplied address family. This returns ipv4 addresses marked as ipv6 ones. Fix from nbd.
2006-12-08__resolv_lock is supposed to be shared, not static Eric Andersen
2006-12-07Major cleanup of internal mutex locking. Be more consistant in how we doEric Andersen
things, and avoid potential deadlocks caused when a thread holding a uClibc internal lock get canceled and terminates without releasing the lock. This change also provides a single place, bits/uClibc_mutex.h, for thread libraries to modify to change all instances of internal locking.
2006-07-31fix h_alias handling in gethostbyaddr_r() just like in gethostbyname_r()Mike Frysinger
otherwise we get messed up alias memory and this simple test case will segfault: python -c 'import socket; print socket.gethostbyaddr("80.68.88.204")[2];' see bug report in blackfin tracker for more info: http://blackfin.uclinux.org/tracker/index.php?func=detail&aid=1503&group_id=17&atid=141
2006-03-23select needs sys/select.h, str[n]casecmp/ffs needs strings.h, if BSD is not ↵Peter S. Mazinger
defined, gettimeofday has other prototype and tm_gmtoff/tm_zone do not exist
2006-03-22Correct build if UCLIBC_HAS_CTYPE_TABLES is not definedPeter S. Mazinger
2006-03-10Remove all non-constant libc_hidden_data_def(), it is too unreliable, sorry, ↵Peter S. Mazinger
most of global data relocations are back
2006-02-01global data uses libc_hidden_data_def, convert all -I hope- and add some newPeter S. Mazinger
2006-01-26Get rid of missing prototype warningsPeter S. Mazinger
2006-01-16Last relocs jump and global data, (even locales) that I could remove are ↵Peter S. Mazinger
gone from libc. The remaining are left as exercise for others ;-)
2006-01-16some global data relocs gonePeter S. Mazinger
2006-01-14make DODEBUG=y happy, update sysdeps/common/* copyrightPeter S. Mazinger
2006-01-14hidden_def/hidden_proto: convert all users (I hope) termios split, add some ↵Peter S. Mazinger
missing headers, other jump relocs removed
2006-01-08hide internal symbolsMike Frysinger
2005-12-16Convert some users and get rid of __rpc_thread_createerr jump reloc, this ↵Peter S. Mazinger
was indeed a badly chosen name
2005-12-09Implement hidden poll, switch user to hidden *printf/*scanf/pollPeter S. Mazinger
2005-12-08mmap/mremap/socket/rewind gonePeter S. Mazinger
2005-12-08Convert the rest of users to hiddenPeter S. Mazinger
2005-12-08Again rpc ;-( , all *inet*, *addr*Peter S. Mazinger
2005-12-07Hide morePeter S. Mazinger
2005-12-06Make use internal str*casecmp/wcscollPeter S. Mazinger
2005-12-06macro out the thread funcs in libc if threading is disabledMike Frysinger
2005-12-03Rename newly created __libc_x (reserved for libpthread overwrites) w/ ↵Peter S. Mazinger
x_internal, do not use cascading aliases
2005-12-03More hiding, including __mempcpyPeter S. Mazinger
2005-12-01Hide mostly used functionsPeter S. Mazinger
2005-11-29Hiding againPeter S. Mazinger
2005-11-27Hide some of mem* and str*Peter S. Mazinger
2005-11-26100 JUMP relocs less (remaining 431) by hiding internally used onesPeter S. Mazinger
2005-11-26Some more hidden internalsPeter S. Mazinger
2005-10-20Better solution to duplicate locking definesPeter S. Mazinger
2005-10-20Change in_addr_t inet_aton to int, glibc has it as int and uClibc uses it in ↵Peter S. Mazinger
addr.c also as int. Rename mylock/LOCK/UNLOCK in resolv.c to allow IMA compiling
2005-05-10The default static buffer sizes are too small to handle the 8 entries returnedEric Andersen
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.
2005-04-28Fix it so uClibc returns multiple ips via h_addr_list,Eric Andersen
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
2005-04-28Cleanup error case a bitEric Andersen
2005-04-28This might actually now be thread safe, assuming I havn't broken it.Eric Andersen
2005-04-28trim trailing whitespaceEric Andersen
2005-01-11Jan Lana writes:Eric Andersen
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
2004-09-07Implement gethostent_rEric Andersen
2004-09-07Remove stale leftoversEric Andersen