aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/posix/getaddrinfo.c
AgeCommit message (Collapse)Author
2012-11-19Return EAI_SYSTEM if we're out of file descriptorsSiddhesh Poyarekar
Resolves BZ #14719.
2012-10-30Suppress incorrect link warnings for NSS symbolsChris Metcalf
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.
2012-09-28 [BZ #11438]Jeff Law
* 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.
2012-08-22 * sysdeps/posix/getaddrinfo.c (gaih_inet): Only use gethostbyname4_rJeff Law
if the family is PF_UNSPEC.
2012-08-17Fix typo in last change.Roland McGrath
2012-08-17Fix getaddrinfo for [!_STATBUF_ST_NSEC] case.Roland McGrath
2012-07-12Avoid duplicate DNS requests if answer is longer than a implementationJeroen van Bemmel
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).
2012-05-10Hurd: libc_once_getThomas Schwinge
2011-11-15Clean up internal fopen usesUlrich Drepper
No need to ever not use c and e.
2011-10-31Cache network interface informationUlrich Drepper
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.
2011-08-04Fix encoding name for IDN in getaddrinfoAndreas Schwab
2011-06-30Make sure RES_USE_INET6 is always restoredAndreas Schwab
2011-06-22Avoid __check_pf calls in getaddrinfo unless really neededUlrich Drepper
2011-06-22Fix Ipv4&IPv6 lookup in getaddrinfoAndreas Schwab
Problem introduced in the last patch.
2011-06-21Fix IPv6-only lookups through getaddrinfoUlrich Drepper
A recent patch introduced a problem where IPv6 lookups happily returned IPv4 addresses.
2011-06-21Minor optimization of getaddrinfo after recent patchUlrich Drepper
2011-06-13Fix memory leak in getaddrinfoUlrich Drepper
2011-05-29Restore _res correctlyUlrich Drepper
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.
2011-05-20Don't unconditionally use alloca in gaih_inetUlrich Drepper
2011-05-02getaddrinfo(AF_INET6) does not return scope_id info provided by NSS modulesMaciej Babinski
2011-01-19Fix decoding of canonical name in getaddrinfo.Ulrich Drepper
2010-08-11Add self-contained test for NSS.Ulrich Drepper
While at it fix interaction between __nss_configure_lookup and nscd. Otherwise the test fails if nscd is runnung.
2010-03-26Fix one case of last checkin.Ulrich Drepper
If the v4 lookup failed but v6 succeeded we treat this as a success.
2010-03-26Don't abort immediately on successful lookup in getaddrinfo.Ulrich Drepper
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.
2010-03-26Fix spurious UNAVAIL status is getaddrinfoAndreas Schwab
2009-12-10Fix a few error cases in *name4_r lookup handling.Ulrich Drepper
2009-07-25Handle missing NSS modules and those without callbacks.Ulrich Drepper
getaddrinfo didn't update the status variable in that round of the loop if no callback was used.
2008-12-29* sysdeps/posix/getaddrinfo.c (gaih_inet): When theUlrich Drepper
gethostbyname4_r function call succeeded, just leave the loop.
2008-12-03* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): RecognizeUlrich Drepper
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.
2008-11-27* sysdeps/posix/getaddrinfo.c (getaddrinfo): Only restrict searchUlrich Drepper
to IPv4 or IPv6 if an interface has been found.
2008-11-27* sysdeps/posix/getaddrinfo.c (getaddrinfo): If the system hasUlrich Drepper
neither IPv4 nor IPv6 addresses defined, don't do anything.
2008-07-30* sysdeps/posix/getaddrinfo.c (gaih_inet): Raise size of initialUlrich Drepper
buffer passed to NSS functions.
2008-06-13* sysdeps/posix/getaddrinfo.c: Move _res_hconf_init call to aUlrich Drepper
better place so it is not called when nscd is used.
2008-05-17* sysdeps/posix/getaddrinfo.c (gaih_inet): If nscd reports noUlrich Drepper
entry is available, believe it.
2008-05-16* sysdeps/posix/getaddrinfo.c (gaih_inet): After gethostbyname4_rUlrich Drepper
lookup, don't assign canon unconditionally.
2008-05-14(match_prefix): Don't treat IPv4 loopback address special whenUlrich Drepper
converting to v4 mapped addressed.
2008-05-14* sysdeps/posix/getaddrinfo.c (get_scope): Loopback addresses haveUlrich Drepper
to be treated like link-local addresses.
2008-05-14* sysdeps/posix/getaddrinfo.c (getaddrinfo): Add _res_hconf_initUlrich Drepper
if necessary.
2008-05-14* sysdeps/posix/getaddrinfo.c: Implement handling of DCCP, UDPlite,Ulrich Drepper
and SCTP.
2008-05-14* sysdeps/posix/getaddrinfo.c: Implement handling of DCCP andUlrich Drepper
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.
2008-05-10* include/resolv.h: Adjust __libc_res_nquery and __libc_res_nsendUlrich Drepper
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.
2008-03-26* posix/gai.conf: Fix comment for scope nullbits.Ulrich Drepper
* sysdeps/posix/getaddrinfo.c (gaiconf_init): If /bits is not present, default to 128 bits for v4 mapped addresses.
2008-01-16* sysdeps/posix/getaddrinfo.c (default_labels): Adjust for changeUlrich Drepper
of names of in in6_addr. (default_precedence): Likewise. * sysdeps/unix/sysv/linux/cmsg_nxthdr.c: Include <stddef.h> for NULL definition.
2008-01-10* sysdeps/posix/getaddrinfo.c (rfc3484_sort): Store result ofUlrich Drepper
native interface lookup in all the relevant places.
2008-01-10* sysdeps/posix/getaddrinfo.c (sort_results): Remove service_orderUlrich Drepper
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.
2007-11-20* sysdeps/posix/getaddrinfo.c (defaults_scopes, scopes): New variables.Ulrich Drepper
(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.
2007-11-19* sysdeps/posix/getaddrinfo.c (default_labels): Describe entry forUlrich Drepper
Teredo tunnels.
2007-11-14* include/ifaddrs.h: Remove in6ai_temporary.Ulrich Drepper
(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.
2007-11-12* include/ifaddrs.c (struct in6addrinfo): Add prefixlen field.Ulrich Drepper
* 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.
2007-10-17* sysdeps/posix/getaddrinfo.c (getaddrinfo): When sorting addressesUlrich Drepper
and admin selects to be able to replace the gai.conf file, lock data structures around the qsort call.