about summary refs log tree commit diff
path: root/resolv/res_send.c
Commit message (Collapse)AuthorAgeFilesLines
* Correctly copy resolver address. Fixes bug #13028.Ondřej Bílka2013-10-141-1/+1
|
* Don't try to use ioctl unless [FIONREAD].Roland McGrath2013-08-271-1/+4
|
* Fix typos.Ondřej Bílka2013-08-211-1/+1
|
* Remove lots of inline keywords.Roland McGrath2013-02-071-2/+2
|
* Add recvmmsg and sendmmsg to the generic glibc API.Thomas Schwinge2012-11-201-1/+1
|
* Better error handling for sendmmsg use in res_sendUlrich Drepper2012-03-301-5/+7
|
* Correct check for DNS request send successUlrich Drepper2012-03-301-1/+1
| | | | | | This predates the sendmmsg use. The two requests can use different request sizes but the check for successful transfer always only used buflen.
* Speed up DNS by avoiding a system call if possibleUlrich Drepper2012-03-301-17/+83
|
* Fix typo in recent resolver change which causes segvsUlrich Drepper2011-06-151-2/+2
|
* Handle DNS server failures in case of AF_UNSPEC lookups correctlyUlrich Drepper2011-05-301-4/+8
|
* Fix debug statements in resolverAndreas Schwab2010-03-171-7/+10
|
* Fix DEBUG statements in resolv/res_send.cYann Droneaud2010-03-051-19/+20
|
* Always use IPv4 sockets for IPv4 addresses.Ulrich Drepper2010-01-141-35/+9
|
* Initialize local variable in resolver.Ulrich Drepper2009-10-291-1/+2
| | | | | When the DNS server doesn't reply at all we possibly tested an unitialized variable.
* Fix mixing IPv4 and IPv6 name server in resolv.conf.Petar Bogdanovic2009-10-291-26/+26
|
* Handle SERVFAIL, NOTIMP, REFUSED replies from DNS server better.Ulrich Drepper2009-07-261-5/+1
| | | | | When doing IPv4+6 lookups we have to pass up the error record from send_dg.
* Implement second fallback mode for DNS requests.Ulrich Drepper2009-06-261-19/+49
| | | | | | | | | | | | There is some more shardware/software out there which has problems if two DNS requests are sent using the same tuple (source addr, source port, dest addr, dest port) This can range from firewalls to load balancers. Some of the vendors already fixed it in response to this problem. Still, we need a way to make glibc work with broken environments. The single-request-reopen flag can be used or we fall back automatically to this mode.
* Remember we switched to single-request mode.Ulrich Drepper2009-06-111-1/+2
| | | | | This change prevents repetition in most later calls of the resolver in case the DNS server or the network connection is broken.
* (send_dg): Don't just ignore the result we got in case we only receive one ↵Ulrich Drepper2009-04-161-6/+10
| | | | reply in single-request mode.
* * resolv/res_send.c (send_dg): Don't switch into single-requestUlrich Drepper2009-04-161-1/+3
| | | | mode if we already are in it.
* * resolv/resolv.h (RES_SNGLKUP): Define. cvs/fedora-glibc-20090407T0545Ulrich Drepper2009-04-071-11/+26
| | | | | | | * resolv/res_init.c (res_setoptions): Recognize single-request option. * resolv/res_send.c (send_dg): If we sent two requests at once and only get one reply before timeout switch to mode where we send the second request only after the first answer has been received.
* * resolv/res_send.c (send_dg): Use correct guards for SOCK_CLOEXECUlrich Drepper2008-12-081-3/+3
| | | | | | | use. * sysdeps/unix/sysv/linux/kernel-features.h: Fix typo in accept4 handling.
* * resolv/res_send.c (send_dg): Create sockets with non-blockingUlrich Drepper2008-12-021-11/+47
| | | | flag already set.
* [BZ #6942]Ulrich Drepper2008-10-311-1/+9
| | | | | | | 2008-10-07 Andreas Schwab <schwab@suse.de> [BZ #6942] * resolv/res_send.c (send_vc): Fix last change. (send_dg): Align here as well.
* * grp/initgroups.c (internal_getgrouplist): Don't prematurelyUlrich Drepper2008-10-301-1/+1
| | | | abort if there is no initgroups_dyn function.
* * resolv/res_send.c (send_dg): On timeout, only return nonzeroUlrich Drepper2008-10-301-1/+1
| | | | result if any of the queries really provided an answer.
* (send_vc): Fix use of unaligned address. Properly handle partial reads.Ulrich Drepper2008-10-061-3/+11
|
* * resolv/res_send.c (__libc_res_nsend): Take additional parameter. cvs/fedora-glibc-20080728T2320Ulrich Drepper2008-07-281-27/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use it instead of locally defined resplen2 variable. (res_nsend): Adjust for __libc_res_nsend interface change. (send_vc): Initialize *resplen2 if necessary. Read length of package into an appropriately aligned variable. Store converted length in new variable and use it appropriately. Add branch prediction help. * resolv/res_query.c (__libc_res_nquery): Take additional parameter and pass it on to __libc_res_nsend. Adjust all callers. (__libc_res_nsearch): Likewise. (__libc_res_nqeurydomain): Likewise. * resolv/nss_dns/dns-host.c: Adjust for __libc_res_nsearch interface change. (_nss_dns_gethostbyname4): Don't unconditionally allocate tmp array. Define resplen2 variable and pass it to __libc_res_nsearch and then to gaih_getanswer. (getanswer_r): In case of incorrect DNS data don't overread buffer. Add branch prediction. (gaih_getanswer_slice): Likewise. Check for invalid data types. (gaih_getanswer): Don't decode second slice if first one failed due to a too small buffer. Don't let not found status of second decoder shadow results of the first. * resolv/gethnamaddr.c (gethostbyname2): Adjust for __libc_res_nsearch and __libc_res_nquery interface changes (gethostbyaddr): Adjust for __libc_res_nquery interface change. * include/resolv.h: Adjust prototypes for __libc_res_nquery, __libc_res_nsearch, and __libc_res_nsend. * resolv/nss_dns/dns-canon.c: Adjust for __libc_res_nquery interface change. * resolv/nss_dns/dns-network.c: Adjust for __libc_res_nquery and __libc_res_nsearch interface changes.
* * resolv/res_send.c: Remove unnecessary res_pquery prototype.Ulrich Drepper2008-07-091-1/+0
|
* * resolv/res_send.c (send_dg): If we already have one of twoUlrich Drepper2008-05-241-6/+24
| | | | | answers and the server reports SERVFAI, NOTIMP, or REFUSED, then use the one answer insted of failing.
* * resolv/res_query.c (__libc_res_nquery): In case one of twoUlrich Drepper2008-05-191-0/+7
| | | | | | | | answer was too short don't try to read that answer's header. * resolv/res_send.c (send_dg): In case of timeout and there are two queries and one has been answered, return value indicating success.
* * include/resolv.h: Adjust __libc_res_nquery and __libc_res_nsendUlrich Drepper2008-05-101-81/+242
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prototypes. * include/arpa/nameser_compat.h: Define T_UNSPEC. * nis/Versions (libnss_nis): Export _nss_nis_gethostbyname4_r. (libnss_nisplus): Export _nss_nisplus_gethostbyname4_r. * nis/nss_nis/nis-hosts.c (LINE_PARSER): Change to also handle af==AF_UNSPEC. (_nss_nis_gethostbyname4_r): New function. * nis/nss_nisplus/nisplus-hosts.c (_nss_nisplus_parse_hostent): Change to also handle af==AF_UNSPEC. (get_tablename): New function. Use it to avoid duplication. (_nss_nisplus_gethostbyname4_r): New function. * nscd/aicache.c (addhstaiX): Use gethostbyname4_r function is available. * nss/Versions (libnss_files): Export _nss_files_gethostbyname4_r. * nss/nss.h: Define struct gaih_addrtuple. * nss/nss_files/files-hosts.c (LINE_PARSER): Change to also handle af==AF_UNSPEC. (_nss_files_gethostbyname4_r): New function. * resolv/Versions (libnss_dns): Export _nss_dns_gethostbyname4_r. * resolv/gethnmaddr.c: Adjust __libc_res_nsearch and __libc_res_nquery calls. * resolv/res_query.c (__libc_res_nquery): Take two additional parameters for second answer buffer. Handle type=T_UNSPEC to mean look up IPv4 and IPv6. Change all callers. * resolv/res_send.c (__libc_res_nsend): Take five aditional parameters for an additional query and answer buffer. Pass to send_vc and send_dg. (send_vc): Send possibly two requests and receive two answers. (send_dg): Likewise. * resolv/nss_dns/dns-host.c: Adjust calls to __libc_res_nsearch and __libc_res_nquery. (_nss_dns_gethostbyname4_r): New function. (gaih_getanswer_slice): Likewise. (gaih_getanswer): Likewise. * resolv/nss_dns/dns-canon.c (_nss_dns_getcanonname_r): Adjust __libc_res_nquery call. * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyaddr_r): Likewise. (_nss_dns_getnetbyname_r): Adjust __libc_res_nsearch call. * sysdeps/posix/getaddrinfo.c: Use gethostbyname4_r function is available.
* [BZ #4726]Ulrich Drepper2007-08-221-3/+6
| | | | | * resolv/res_send.c (__libc_res_nsend): Initialize all of the memory allocated for the name server address.
* [BZ #4647]Ulrich Drepper2007-06-181-7/+8
| | | | | | | | | | | | | | | | Tomas Janousek <tjanouse@redhat.com> Ulrich Drepper <drepper@redhat.com> [BZ #4647] * resolv/res_send.c (send_dg): Remove socket_pf. Use ipv6_unavail member in __res_state, only convaddr4to6 if nssocks[ns] is a PF_INET6 socket. * resolv/resolv.h (__res_state): Add ipv6_unavail member. Make unused member a bitmap. * resolv/res_init.c (__res_vinit): Reset ipv6_unavail if IPv6 servers are configured. 2007-06-18 Jakub Jelinek <jakub@redhat.com>
* * resolv/res_init.c (res_setoptions): Recognize edns0 option.Ulrich Drepper2007-02-091-0/+18
| | | | | | | | | | * resolv/res_mkquery.c: Define __res_nopt. * resolv/res_query.c (__libc_res_nquery): If RES_USE_EDNS0 is set try adding EDNS0 record. * resolv/res_send.c (send_dg): If request failed with FORMERR and EDNS0 record was send make sure we don't try it again. * resolv/resolv.h: Define RES_F_EDNS0ERR and RES_USE_EDNS0. * include/resolv.h: Declare __res_nopt.
* * include/arpa/nameser.h: Also optimize NS_PUT16 and NS_PUT32.Ulrich Drepper2006-05-061-1/+1
| | | | | | | | * resolv/res_mkquery.c: Use NS_PUT16 and NS_PUT32 instead of __putshort and __putlong respectively. Correct buffer overflow check for NS_NOTIFY_OP. * resolv/res_send.c (send_vc): Use ns_put16 instead of putshort.
* * resolv/res_send.c (res_queriesmatch): Fix typo in comment.Ulrich Drepper2006-05-061-22/+14
| | | | | (send_dg): Rewrite error handling to be more compact and avoid double recomputation of timeouts. Pass MSG_NOSIGNAL to send.
* * include/arpa/nameser.h: Add optimizations for NS_GET16 and NS_GET32.Ulrich Drepper2006-05-061-8/+13
| | | | | | * resolv/res_send.c (res_nameinquery): Use NS_GET16 directly instead of ns_get16. (res_queriesmatch): Likewise. Minor optimization.
* * resolv/res_init.c (__res_iclose): New function. Broken out ofUlrich Drepper2005-11-011-24/+22
| | | | | | | | | | | | | | | | | res_nclose. Take addition parameter which determines whether addresses should be freed. (res_nclose): Call __res_iclose. (res_thread_freeres): Likewise. * resolv/res_data.c (res_close): Call __res_iclose. * resolv/res_libc.c (res_init): No need to separately free the addresses. (__res_maybe_init): Likewise. * resolv/res_send.c: Use __res_iclose instead of res_nclose. * resolv/Versions [GLIBC_PRIVATE]: Add __res_iclose. * include/resolv.h: Declare __res_iclose. Add libc_hidden_proto for __res_iclose. * hesiod/hesiod.c (__hesiod_res_set): No need to free name server addresses here again.
* * resolv/res_send.c (Aerror): Fix printing IP address. cvs/fedora-glibc-20050822T0727Ulrich Drepper2005-08-221-2/+7
|
* * resolv/res_send.c (send_vc): Pass correct sockaddr size to connect.Ulrich Drepper2005-08-211-1/+3
|
* (send_dg): Recognize referral results and treat them as server errors.Ulrich Drepper2005-07-081-0/+8
|
* [BZ #284, BZ #721]Roland McGrath2005-02-171-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * intl/dcigettext.c (_nl_find_msg): Add a cast. * nis/nis_clone_dir.c (nis_clone_directory): Use char * for ADDR. * nis/nis_clone_obj.c (nis_clone_object): Likewise. * nis/nis_clone_res.c (nis_clone_result): Likewise. * resolv/nss_dns/dns-network.c (getanswer_r): Use const unsigned char * for END_OF_MESSAGE and CP. * resolv/res_send.c (send_dg): Add else branch for case impossible unless `poll' is buggy. * crypt/crypt_util.c (__setkey_r): Add a cast. * locale/programs/linereader.c (get_toplvl_escape): Use size_t for NBYTES, and unsigned char * for BYTES. * locale/programs/charmap.c (charmap_new_char): Use size_t and unsighed char * for NBYTES, BYTES parameters. * sysdeps/generic/dl-hash.h (_dl_elf_hash): Take const char * argument and cast it. * sysdeps/i386/i686/dl-hash.h (_dl_elf_hash): Likewise. * sunrpc/create_xid.c (_create_xid): Don't use unsigned long for RES. * sunrpc/svcauth_des.c (_svcauth_des): Fix cast type. * sunrpc/auth_des.c (authdes_create): Don't use u_char for PKEY_DATA. (authdes_marshal): Don't use unsigned int for LEN. * sunrpc/xdr.c (xdr_hyper): Don't use unsigned long for T2. (xdr_u_hyper): Likewise. (xdr_u_short): Don't use u_long for L. * sunrpc/xdr_intXX_t.c (xdr_int64_t): Don't use uint32_t for T2. * inet/rexec.c (rexec_af): Use socklen_t. * sunrpc/key_call.c (getkeyserv_handle): Likewise. * sunrpc/rtime.c (rtime): Likewise. * resolv/res_send.c (send_vc, send_dg): Likewise. * nis/nis_callback.c (__nis_create_callback): Likewise. * sysdeps/generic/libc-start.c: Use unsigned int for nthreads ptr. * sysdeps/posix/getaddrinfo.c (gaih_inet): Fix type of ADDR local. * libio/libio.h (_IO_BE): Add parenthesis around EXPR. * intl/dcigettext.c (INTVARDEF, INTUSE): Macros removed. (_nl_default_dirname): Use libc_hidden_data_def instead of INTVARDEF. (libc_freeres_fn, DCIGETTEXT): Don't use INTUSE. * intl/bindtextdom.c (INTUSE): Macro removed. (_nl_default_dirname): Use libc_hidden_proto. (set_binding_values): Don't use INTUSE. * include/libintl.h (_libc_intl_domainname_internal): Decl removed. (_libc_intl_domainname): Use libc_hidden_proto. * posix/regex_internal.h (gettext): Remove INTUSE on it. * locale/SYS_libc.c (_libc_intl_domainname): Use libc_hidden_data_def rather than INTDEF. * include/libintl.h (_): Don't use *_internal name. * ctype/ctype-extn.c (__ctype_tolower, __ctype_toupper): Use int32_t, not uint32_t. * locale/lc-ctype.c (_nl_postload_ctype): Likewise for assignments. * iconv/gconv_open.c (__gconv_open): Remove useless cast. [BZ #721] * sysdeps/i386/dl-machine.h (ELF_MACHINE_NO_RELA): Define this outside of [RESOLVE_MAP]. * sysdeps/sh/dl-machine.h (ELF_MACHINE_NO_REL): Likewise. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rel, elf_machine_rel_relative): Removed. * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rel, elf_machine_rel_relative): Removed. 2005-02-03 Alexandre Oliva <aoliva@redhat.com> [BZ #721] * elf/dynamic-link.h: Don't declare nested auto functions that are not going to be defined. 2004-07-23 Jakub Jelinek <jakub@redhat.com> [BZ #284] * include/features.h (_POSIX_SOURCE, _POSIX_C_SOURCE): Define if _XOPEN_SOURCE >= 500 even if __STRICT_ANSI__ is defined. 2005-02-16 Roland McGrath <roland@redhat.com>
* (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper2004-12-221-69/+54
|
* 2.5-18.1Jakub Jelinek2007-07-121-54/+69
|
* Update.Ulrich Drepper2004-10-241-4/+6
| | | | * resolv/res_send.c (send_dg): Cope with failures.
* Update.Ulrich Drepper2004-10-231-137/+127
| | | | | | | 2004-10-23 Ulrich Drepper <drepper@redhat.com> * resolv/res_send.c (send_dg): Combine write and read to socket into one loop.
* Remove compatibility code which is unused in glibc and probably bitrotten.Ulrich Drepper2004-10-231-198/+2
|
* Update.Ulrich Drepper2004-10-181-0/+3
| | | | | | | | | | | | | | | | | | 2004-10-17 Ulrich Drepper <drepper@redhat.com> * include/libc-symbols.h: Define libresolv_hidden_proto and friends. * include/resolv.h: Add libresolv_hidden_proto for symbols defined, used, and exported in libresolv. * resolv/base64.c: Add libresolv_hidden_def. * resolv/gethnamaddr.c: Likewise. * resolv/ns_name.c: Likewise. * resolv/ns_netint.c: Likewise. * resolv/res_comp.c: Likewise. * resolv/res_data.c: Likewise. * resolv/res_debug.c: Likewise. * resolv/res_mkquery.c: Likewise. * resolv/res_query.c: Likewise. * resolv/res_send.c: Likewise.
* Update.Ulrich Drepper2004-10-111-23/+83
| | | | | | * resolv/res_send.c (send_dg): Use nonblocking sockets. Add appropriate poll/select calls and restart operation if necessary. Also handle EINTR.