summaryrefslogtreecommitdiffstats
path: root/libc/inet/resolv.c
Commit message (Collapse)AuthorAgeFilesLines
* resolv: DEBUG-print nameserver we talk toBernhard Reutner-Fischer2010-03-301-2/+18
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* /etc/resolv.conf: support "timeout:n" and "attempts:n" optionsDenys Vlasenko2010-02-031-13/+41
| | | | | | | | | | | | | | text data bss dec hex filename - 1745 2 4 1751 6d7 libc/inet/dnslookup.o + 1760 2 4 1766 6e6 libc/inet/dnslookup.o - 962 0 4 966 3c6 libc/inet/opennameservers.o + 1099 0 4 1103 44f libc/inet/opennameservers.o - 462 4 472 938 3aa libc/inet/res_init.o + 454 4 468 926 39e libc/inet/res_init.o - 870 0 0 870 366 libc/inet/res_query.o + 867 0 0 867 363 libc/inet/res_query.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* errno: hide __libc_resp, __libc_errno, and __libc_h_errnoKhem Raj2010-02-011-1/+1
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libc/inet: mark other odd /etc/conf/ spotBernhard Reutner-Fischer2010-01-231-0/+2
| | | | | | and wrap it in FALLBACK_TO_CONFIG_RESOLVCONF too. -24b Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* check stat("/etc/resolv.conf") for errorsDenys Vlasenko2009-10-141-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libc/inet/resolv.c: reread resolv.conf if its mtime was changedBernhard Reutner-Fischer2009-10-131-6/+9
| | | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* link-time warning for obsolescent/removed network funcsBernhard Reutner-Fischer2009-10-081-0/+4
| | | | Signed-off-by: aldot <rep.dot.nop@gmail.com>
* resolv.c: add support for per thread res_stateAustin Foxley2009-09-261-3/+52
| | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* libc/inet/resolv.c:Denis Vlasenko2009-04-181-276/+465
| | | | | | | | | | | | | | | | Collapse __length_dotted into __length_question (the sole user of it). Make __length_question and __decode_answer static, they are used only once by only one function. Delete __decode_question, it is unused. All in all, four less .o files in libc.a. Document what __dns_lookup returns (length of the packet). Propagate packet len into __decode_answer, __length_question, __decode_dotted and check that we do not use data past the end of the packet. Rename some variables/parameters to better names (len -> packet_len, data -> packet etc). Add mini-doc how DNS packets look like. Style cleanup.
* 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
* - fix comment style to make it compile againBernhard Reutner-Fischer2009-02-131-27/+37
| | | | - add note about "/etc/config/" and the resolver code per se.
* resolv: fix testcase failureDenis Vlasenko2008-12-171-2/+2
| | | | | test/regex/tst-regex2.c: fix testcase to compile with just "gcc <file>.c"
* remove __libc_getdomainname alias. google says only we have it.Denis Vlasenko2008-12-101-6/+1
|
* resolver: make new name resolutions reread /etc/resolv.confDenis Vlasenko2008-12-061-219/+197
| | | | | | | | | | | | | | | | if 256+ seconds passed since last read; fix cases where we switch to next search domain instead of switching to new server optimize ip4/ip6 combined cases; rewrite for(;;) loops so that it's clearer what's going on; document buffer usage; add TODOs and FIXMEs (for one, gethostbyname2 does not fill ->h_aliases field in the result AT ALL, and is iffy in general) text data bss dec hex filename - 245898 1403 11904 259205 3f485 libuClibc-0.9.30-svn.so + 245785 1403 11904 259092 3f414 libuClibc-0.9.30-svn.so
* random: use smaller data fields where appropriateDenis Vlasenko2008-12-011-0/+1
| | | | | | | | | text data bss dec hex filename - 130 156 0 286 11e libc/stdlib/random.o + 130 148 0 278 116 libc/stdlib/random.o - 586 0 0 586 24a libc/stdlib/random_r.o + 570 0 0 570 23a libc/stdlib/random_r.o
* gethostbyname can use gethostbyname2, saving one nearly 0.5k static bufferDenis Vlasenko2008-12-011-15/+20
| | | | | | | text data bss dec hex filename - 45 0 480 525 20d libc/inet/gethostbyname.o + 18 0 0 18 12 libc/inet/gethostbyname.o
* Last portion of libc_hidden_proto removal.Denis Vlasenko2008-11-201-28/+29
| | | | | Appears to build fine (several .configs tried)
* next portion of libc_hidden_proto removalDenis Vlasenko2008-11-201-6/+6
|
* libc_hidden_proto removal, a few more functionsDenis Vlasenko2008-11-181-4/+4
|
* libc_hidden_proto removal, just a few functionsDenis Vlasenko2008-11-181-1/+1
|
* resolver: use timeout of 5 (glibc uses that).Denis Vlasenko2008-11-171-10/+7
| | | | | delete some duplication in constants.
* resolver: separate gethostent and gethostent_r into two .o files;Denis Vlasenko2008-11-171-131/+134
| | | | | delete two stray files which compile to nothing
* resolver: move large code blocks to arrange related functions closer.Denis Vlasenko2008-11-171-510/+489
| | | | | almost no code changes
* resolver: fix some previous TODOs, add new ones.Denis Vlasenko2008-11-171-179/+198
|
* resolver: improved support for overriding DNS server addressesDenis Vlasenko2008-11-161-48/+114
| | | | | in _res structure. Used by busybox's nslookup.
* resolver: make getaddrinfo actually respect _res.nsaddr_list;Denis Vlasenko2008-11-161-202/+335
| | | | | | add largish comment explaining what we are doing, and why; fixes to make IPv6-only resolver possible
* resolver: more locking fixes.Denis Vlasenko2008-11-151-108/+138
|
* fixing resolver part 3: fix completely bogus lockingDenis Vlasenko2008-11-141-304/+311
| | | | | in __dns_lookup.
* fixing resolver part 2: make _res structure membersDenis Vlasenko2008-11-141-11/+17
| | | | | configurable. we don't use most of it anyway.
* fixing resolver, part 1Denis Vlasenko2008-11-141-90/+136
|
* resolver: reinstate searching if search domains accidentally nukedDenis Vlasenko2008-11-021-4/+15
| | | | | in one of recent commits :)
* __dns_lookup: document and optimize a bitDenis Vlasenko2008-11-011-33/+45
| | | | | | | text data bss dec hex filename - 1545 2 4 1551 60f libc/inet/dnslookup.o + 1528 2 4 1534 5fe libc/inet/dnslookup.o
* resolver: partially fix bug 660 -Denis Vlasenko2008-11-011-21/+42
| | | | | do not treat negative response as error
* resolver: fix part of bug 1468:Denis Vlasenko2008-11-011-7/+20
| | | | | "gethostbyname() fails if DNS server returns more than 23 addresses"
* resolver: trivial code trasformations for readability.Denis Vlasenko2008-11-011-89/+96
| | | | | No logic changes. Code size is the same too.
* trivial code shrink by making some strings staticDenis Vlasenko2008-11-011-2/+4
| | | | | | | | | text data bss dec hex filename - 259 0 0 259 103 libc/inet/herror.o + 243 0 0 243 f3 libc/inet/herror.o - 720 0 0 720 2d0 libc/inet/ns_name.o + 710 0 0 710 2c6 libc/inet/ns_name.o
* make getaddrinfo to NOT query DNS for IPv6 address if host is inDenis Vlasenko2008-10-281-17/+31
| | | | | | | | | | | /etc/hosts and it has IPv4 address there. The most common example is "127.0.0.1 localhost". We don't want "ping localhost" to stall and time out on IPv6 queries to, say, inaccessible DNS server, right? - 655 0 0 655 28f libc/inet/gethostbyname2_r.o + 685 0 0 685 2ad libc/inet/gethostbyname2_r.o
* Revert revision 19343 and also remove libc_hidden_proto for __uc_malloc.Bernd Schmidt2008-06-121-34/+16
| | | | | For now, a straight revert; we can decide later wheter we want to do something more.
* Remove superfluous attribute_hidden from functionDenis Vlasenko2008-06-061-1/+1
| | | | | | | | | | | definition. I seems to produce spurious warning: libc/inet/resolv.c:1549: warning: 'visibility' attribute ignored on non-class types (seems like gcc bug) and it is not really needed - attribute_hidden was already specified in function _declaration_ so it is not necessary here. No code changes (verified with objdump).
* Use more natural way to return a value in __read_etc_hosts_r:Denis Vlasenko2008-06-061-24/+21
| | | | | | | | | | | text data bss dec hex filename - 230 0 9 239 ef libc/inet/gethostent.o + 224 0 9 233 e9 libc/inet/gethostent.o - 782 0 0 782 30e libc/inet/read_etc_hosts_r.o + 767 0 0 767 2ff libc/inet/read_etc_hosts_r.o Run tested.
* Fix failure in test/inet/gethost_r-align:Denis Vlasenko2008-06-061-4/+8
| | | | | | | | | | | | we were closing a FILE, but did not record that fact by setting a variable to NULL, and then we used it for reading! While at it, small reduction in bss. Run tested. text data bss dec hex filename - 210 0 12 222 de libc/inet/gethostent.o + 230 0 9 239 ef libc/inet/gethostent.o
* This fixes a problem with the move of libc_hidden_proto to string.h.Bernd Schmidt2008-06-041-1/+0
| | | | | | | | | | | | | The obsolete functions bcopy, index, etc. are not supposed to be used within uClibc itself. Hence, there is no libc_hidden_def for them, but the previous patch did not just move libc_hidden_protos, it also added new ones for the legacy functions. As a result, programs which use these functions can no longer link with uClibc. This fixes it by removing the unnecessary libc_hidden_protos. I've also removed all inclusions of <strings.h> from uClibc source files: since we define _GNU_SOURCE, it is sufficient to include <string.h>. We then do not need to duplicate the libc_hidden_proto block in <strings.h>.
* close bug 473:Denis Vlasenko2008-06-031-33/+39
| | | | | | | 1. names with two consecutive dots are not valid 2. if name ends with a dot, dont try appending search domain(s) alos a few small optimisations are here.
* - adds several config-options to allow for turning off certain featuresBernhard Reutner-Fischer2008-06-031-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | like o UCLIBC_HAS_GNU_ERROR o UCLIBC_HAS_BSD_ERR o UCLIBC_HAS_PTY o UCLIBC_HAS_GETPT (1) o UCLIBC_SYSCALL_STUBS o UCLIBC_SYSCALL_STUB_WARNING o UCLIBC_LINUX_SPECIFIC (2) o UCLIBC_BSD_SPECIFIC (3) o UCLIBC_NTP_LEGACY (4) o UCLIBC_SV4_DEPRECATED (5) o UCLIBC_HAVE_REALTIME (6) o UCLIBC_HAVE_ADVANCED_REALTIME (7) o UCLIBC_HAVE_EPOLL (8) o UCLIBC_HAVE_XATTR (9) o UCLIBC_HAVE_PROFILING (10) (1) make non-standard getpt optional and implement standard posix_openpt (2) fstatfs(), inotify_*(), ioperm(), iopl(), madvise(), modify_ldt(), personality() ppoll(), setresuid() (3) mincore(), getdomainname(), setdomainname() (4) ntp_adjtime(), ntp_gettime() aliases (5) ustat() [use statfs(2) in your code instead] (6) All marked as "(REALTIME)" in SUSv3 (7) All marked as "(ADVANCED REALTIME)" in SUSv3 (8) epoll_create(), epoll_ctl(), epoll_wait() (9) all Extended Attributes (10) helpers for gcc's -finstrument-functions - Fixes _dl_exit() - Implements sleep(3) for !UCLIBC_HAVE_REALTIME - Implements usleep(3) for !UCLIBC_HAVE_REALTIME - adds #warning about incorrect posix_fadvise{,64}() - removes unused and unwanted uselib() Net outcome is that an allnoconfig with HAVE_SHARED is now about 88k instead of formerly 130k.
* libc/inet/resolv.c: use ip6.arpa instead of ip6.int for reverseDenis Vlasenko2008-06-021-87/+88
| | | | | | | IPv6 DNS resolv. rfc4159 mandated this 3 years ago. Closes bug 1020. Also cleans up some stype inconsistensied and saves 2 bytes of rw data.
* Fix build failure due to missing 'smallint' definitionCarmelo Amoroso2008-05-271-1/+0
| | | | | | by adding <unistd.h> header file. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* - remove old-style definitions. No object-code changes.Bernhard Reutner-Fischer2008-05-201-11/+5
|
* Moving libc_hidden_proto's into #ifdef UCLIBC_INTERNAL blockDenis Vlasenko2008-05-191-12/+12
| | | | | | | | | in string.h and strings.h. This caught unguarded string ops in libc/inet/ethers.c __ether_line_w() function. I will wait for fallout reports for a week or so, then continue converting more libc_hidden_proto's.
* add hidden_proto's for __uc_mallocDenis Vlasenko2008-02-121-0/+1
| | | | | (patch by Bernd Schmidt <bernds_cb1 at t-online.de>)
* Use poll() rather than select() if the former is available to wait inPeter Kjellerstedt2008-01-111-0/+26
| | | | | __dns_lookup(). This avoids segmentation faults when more than 1024 file descriptors are used by an application.