about summary refs log tree commit diff
path: root/sysdeps/posix/getaddrinfo.c
Commit message (Collapse)AuthorAgeFilesLines
* Return EAI_SYSTEM if we're out of file descriptorsSiddhesh Poyarekar2012-11-191-0/+6
| | | | Resolves BZ #14719.
* Suppress incorrect link warnings for NSS symbolsChris Metcalf2012-10-301-1/+1
| | | | | | | | | When glibc is built with --enable-static-nss, the warning that using NSS symbols requires the nss shared objects to be present is no longer true, as those symbols are built into libc. Suppress the warning for those symbols by providing a new macro (nss_interface_function) for the NSS functions that is defined as static_link_warning in the normal case, and empty for static NSS.
* [BZ #11438]Jeff Law2012-09-281-4/+0
| | | | | | | | | * sysdeps/posix/getaddrinfo.c (default_scopes): Map RFC 1918 * addresses to global scope. * posix/tst-rfc3484.c: Verify 10/8, 172.16/12 and 196.128/16 addresses are in the same scope as 192.0.2/24. * posix/gai.conf: Document new scope table defaults.
* * sysdeps/posix/getaddrinfo.c (gaih_inet): Only use gethostbyname4_rJeff Law2012-08-221-2/+7
| | | | if the family is PF_UNSPEC.
* Fix typo in last change.Roland McGrath2012-08-171-1/+1
|
* Fix getaddrinfo for [!_STATBUF_ST_NSEC] case.Roland McGrath2012-08-171-2/+35
|
* Avoid duplicate DNS requests if answer is longer than a implementationJeroen van Bemmel2012-07-121-3/+7
| | | | | | | | | | | | | | | | limit [BZ #14307] * sysdeps/posix/getaddrinfo.c (gaih_inet): Increase the size of the temporary buffer used to invoke __gethostbyname2_r, __gethostbyaddr_r and gethostbyname4_r to make room for struct host_data / struct gaih_addrtuple. * resolv/nss_dns/dns-host.c (global scope): Move definition of implementation constants MAX_NR_ALIASES and MAX_NR_ADDRS to header file nss/nsswitch.h. * nss/nsswitch.h (global scope): Add definition of implementation constants MAX_NR_ALIASES and MAX_NR_ADDRS (moved from resolv/nss_dns/dns-host.c).
* Hurd: libc_once_getThomas Schwinge2012-05-101-1/+1
|
* Clean up internal fopen usesUlrich Drepper2011-11-151-1/+1
| | | | No need to ever not use c and e.
* Cache network interface informationUlrich Drepper2011-10-311-5/+5
| | | | | | | | | | | | Whenever getaddrinfo needed network interface information it used the netlink interface to read the information every single time. The problem is that this information can change at any time. The patch implements monitoring of the network interfaces through nscd. If no change is detected the previously read information can be reused (which is the norm). This timestamp information is also made available to other processes using the shared memory segment between nscd and those processes.
* Fix encoding name for IDN in getaddrinfoAndreas Schwab2011-08-041-1/+4
|
* Make sure RES_USE_INET6 is always restoredAndreas Schwab2011-06-301-0/+4
|
* Avoid __check_pf calls in getaddrinfo unless really neededUlrich Drepper2011-06-221-5/+12
|
* Fix Ipv4&IPv6 lookup in getaddrinfoAndreas Schwab2011-06-221-1/+1
| | | | Problem introduced in the last patch.
* Fix IPv6-only lookups through getaddrinfoUlrich Drepper2011-06-211-3/+31
| | | | | A recent patch introduced a problem where IPv6 lookups happily returned IPv4 addresses.
* Minor optimization of getaddrinfo after recent patchUlrich Drepper2011-06-211-14/+4
|
* Fix memory leak in getaddrinfoUlrich Drepper2011-06-131-1/+1
|
* Restore _res correctlyUlrich Drepper2011-05-291-2/+2
| | | | | | getaddrinfo works around the resolver functionality to avoid automatic IPv6 lookups. The restoring didn't allow for the resolver to set additional bits in _res.
* Don't unconditionally use alloca in gaih_inetUlrich Drepper2011-05-201-91/+342
|
* getaddrinfo(AF_INET6) does not return scope_id info provided by NSS modulesMaciej Babinski2011-05-021-45/+28
|
* Fix decoding of canonical name in getaddrinfo.Ulrich Drepper2011-01-191-0/+1
|
* Add self-contained test for NSS.Ulrich Drepper2010-08-111-1/+2
| | | | | While at it fix interaction between __nss_configure_lookup and nscd. Otherwise the test fails if nscd is runnung.
* Fix one case of last checkin.Ulrich Drepper2010-03-261-0/+1
| | | | If the v4 lookup failed but v6 succeeded we treat this as a success.
* Don't abort immediately on successful lookup in getaddrinfo.Ulrich Drepper2010-03-261-10/+10
| | | | | | | When not using gethostbyname4 methods we immediately aborted the loop over the nss modules on the first successful lookup. While this is almost always what is wanted the nsswitch.conf file allows to select something different.
* Fix spurious UNAVAIL status is getaddrinfoAndreas Schwab2010-03-261-0/+1
|
* Fix a few error cases in *name4_r lookup handling.Ulrich Drepper2009-12-101-7/+2
|
* Handle missing NSS modules and those without callbacks.Ulrich Drepper2009-07-251-0/+2
| | | | | getaddrinfo didn't update the status variable in that round of the loop if no callback was used.
* * sysdeps/posix/getaddrinfo.c (gaih_inet): When theUlrich Drepper2008-12-291-0/+2
| | | | gethostbyname4_r function call succeeded, just leave the loop.
* * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): RecognizeUlrich Drepper2008-12-031-0/+2
| | | | | | | | | ESRCH return value. (_nss_dns_gethostbyname4_r): Likewise. * resolv/res_init.c (__res_vinit): Initialize nscount to zero. * sysdeps/posix/getaddrinfo.c (gaih_inet): In case we use gethostbyname4_r, we don't have a separate IPv6 status, so copy the no_data variable.
* * sysdeps/posix/getaddrinfo.c (getaddrinfo): Only restrict searchUlrich Drepper2008-11-271-7/+1
| | | | to IPv4 or IPv6 if an interface has been found.
* * sysdeps/posix/getaddrinfo.c (getaddrinfo): If the system hasUlrich Drepper2008-11-271-0/+6
| | | | neither IPv4 nor IPv6 addresses defined, don't do anything.
* * sysdeps/posix/getaddrinfo.c (gaih_inet): Raise size of initialUlrich Drepper2008-07-301-1/+1
| | | | buffer passed to NSS functions.
* * sysdeps/posix/getaddrinfo.c: Move _res_hconf_init call to aUlrich Drepper2008-06-131-21/+9
| | | | better place so it is not called when nscd is used.
* * sysdeps/posix/getaddrinfo.c (gaih_inet): If nscd reports noUlrich Drepper2008-05-171-1/+4
| | | | entry is available, believe it.
* * sysdeps/posix/getaddrinfo.c (gaih_inet): After gethostbyname4_rUlrich Drepper2008-05-161-2/+3
| | | | lookup, don't assign canon unconditionally.
* (match_prefix): Don't treat IPv4 loopback address special whenUlrich Drepper2008-05-141-11/+5
| | | | converting to v4 mapped addressed.
* * sysdeps/posix/getaddrinfo.c (get_scope): Loopback addresses haveUlrich Drepper2008-05-141-1/+4
| | | | to be treated like link-local addresses.
* * sysdeps/posix/getaddrinfo.c (getaddrinfo): Add _res_hconf_initUlrich Drepper2008-05-141-0/+5
| | | | if necessary.
* * sysdeps/posix/getaddrinfo.c: Implement handling of DCCP, UDPlite,Ulrich Drepper2008-05-141-0/+4
| | | | and SCTP.
* * sysdeps/posix/getaddrinfo.c: Implement handling of DCCP andUlrich Drepper2008-05-141-17/+25
| | | | | | | | | | UDPlite. * nss/getent.c (ahosts_keys_int): Handle all known socket types. * inet/netinet/in.h (IPPIPPROTO_DCCP, IPPROTO_UDPLITE): Define. * sysdeps/unix/sysv/linux/bits/socket.h (SOCK_DCCP): Define.
* * include/resolv.h: Adjust __libc_res_nquery and __libc_res_nsendUlrich Drepper2008-05-101-73/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * posix/gai.conf: Fix comment for scope nullbits.Ulrich Drepper2008-03-261-0/+1
| | | | | * sysdeps/posix/getaddrinfo.c (gaiconf_init): If /bits is not present, default to 128 bits for v4 mapped addresses.
* * sysdeps/posix/getaddrinfo.c (default_labels): Adjust for changeUlrich Drepper2008-01-161-52/+52
| | | | | | | of names of in in6_addr. (default_precedence): Likewise. * sysdeps/unix/sysv/linux/cmsg_nxthdr.c: Include <stddef.h> for NULL definition.
* * sysdeps/posix/getaddrinfo.c (rfc3484_sort): Store result ofUlrich Drepper2008-01-101-12/+39
| | | | native interface lookup in all the relevant places.
* * sysdeps/posix/getaddrinfo.c (sort_results): Remove service_orderUlrich Drepper2008-01-101-37/+37
| | | | | | | | | | | | | | | | | field. Use sockaddr_in6 for source_addr. (get_scope): Change type of parameter to sockaddr_in6. Adjust. (match_prefix): Likewise. (get_label): Likewise. (get_precedence): Likewise. (rfc3484_sort): Change to use indirect access to results array. Adjust to use of sockaddr_in6. Replace service_order test with simple index comparison. (getaddrinfo): Define order array. Initialize it. Don't initialize service_order field. Adjust qsort_t calls. Access sorted result array indirectly through order array. * posix/tst-rfc3484.c: Adjust for change of rfc3484_sort. * posix/tst-rfc3484-2.c: Likewise. * posix/tst-rfc3484-3.c: Likewise.
* * sysdeps/posix/getaddrinfo.c (defaults_scopes, scopes): New variables.Ulrich Drepper2007-11-201-13/+201
| | | | | | | | | | | | | (get_scope): For IPv4 scope, use scopes table. (fini): Free scopes table if necessary. (free_scopelist): New function. (scopecmp): New function. (gaiconf_init): Also handle scopev4 entries. * posix/tst-rfc3484.c (do_test): Initialize scopes. * posix/tst-rfc3484-2.c (do_test): Likewise. * posix/gai.conf: Document scopev4 defaults. * posix/Makefile (tests): Add tst-rfc3484-3. * posix/tst-rfc3484-3.c: New file.
* * sysdeps/posix/getaddrinfo.c (default_labels): Describe entry forUlrich Drepper2007-11-191-0/+1
| | | | Teredo tunnels.
* * include/ifaddrs.h: Remove in6ai_temporary.Ulrich Drepper2007-11-141-63/+46
| | | | | | | | | | | | | | | | | (struct in6addrinfo): Add index element. Declare __check_native. * inet/Makefile (aux): Add check_native. * sysdeps/unix/sysv/linux/check_native.c: New file. * sysdeps/unix/sysv/linux/check_pf.c: No need to recognize IFA_F_TEMPORARY. Pass back ifa_index. * sysdeps/posix/getaddrinfo.c: Remove netlink compatibility code. (rfc3484_sort): Add new parameter. Implement rule 7 correctly: call __check_native if necessary. (getaddrinfo): Fill in index field. Use qsort_r instead of qsort to sort addresses. Pass information about the results. * posix/tst-rfc3484.c: Adjust for addition of index field and change of rfc3484_sort interface. * posix/tst-rfc3484-2.c: Likewise.
* * include/ifaddrs.c (struct in6addrinfo): Add prefixlen field.Ulrich Drepper2007-11-121-74/+91
| | | | | | | | | | | * sysdeps/unix/sysv/linux/check_pf.c (make_request): Always return list of interfaces. Also store prefix length. * sysdeps/posix/getaddrinfo.c (sort_result): Add prefixlen element. (rfc3484_sort): In rule 9, for IPv4 addresses count only matching prefix if source and destination address are in the same subnet. (getaddrinfo): Always call __check_pf. Fill in prefixlen field. Always look for matching record in in6ai list. Correct source_addr_len value for IPv6->IPv4 converted records.
* * sysdeps/posix/getaddrinfo.c (getaddrinfo): When sorting addressesUlrich Drepper2007-10-171-6/+21
| | | | | and admin selects to be able to replace the gai.conf file, lock data structures around the qsort call.