summaryrefslogtreecommitdiffstats
path: root/lib/libc/asr/getaddrinfo_async.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* When checking for available address family for AI_ADDRCONFIG considerflorian2021-01-261-1/+16
| | | | | | | | the routing domain we are currently in. Otherwise we might end up with address families that are not available in the current rdomain but in others since getifaddrs(3) gives us all interface addresses in the system. Clue-bat & OK claudio, input & OK eric, OK kn
* For correctness, do not read struct servent if getservbyname_r() failed.eric2018-11-031-7/+5
| | | | Also simplify code.
* More "explicitely" -> "explicitly" in various comments.krw2018-10-221-2/+2
| | | | ok guenther@ tb@ deraadt@
* Put a common flags field in the query struct, rather than in somejca2017-02-271-7/+7
| | | | | | | | | elements of the union. This field is for internal asr flags. The flags in "struct rrset" and "struct ni" are different kinds of flags. ok eric@
* Put a common subq pointer in the query struct, rather than one in eacheric2017-02-231-5/+5
| | | | | | element of the union. ok gilles@ millert@ krw@
* missing breakseric2017-02-211-1/+2
| | | | ok jca@ krw@ gilles@
* Report the errno set by getifaddrs(3) if the setup for AI_ADDRCONFIG fails,eric2017-02-211-4/+5
| | | | | | | rather than a non-informative EAI_FAIL. Compare to -1 for error detection while here. ok jca@ gilles@
* Remove support for HOSTALIASES from the resolver. This "open and parsederaadt2015-12-161-4/+1
| | | | | | | | any file indicated by an environment variable" feature inside the resolver is incompatible with what pledge "dns" is trying to be. It is a misguided "feature" added way back in history which almost noone uses, but everyone has to assume the risk from. ok eric florian kettenis
* Remove support for "lookup yp" in /etc/resolv.conf. This historicalderaadt2015-11-231-101/+1
| | | | | | | | wart is incompatible with pledge, because suddenly a "dns" operation needs "getpw" access to ypbind/ypserv, etc. file + dns access is enough for everyone, sorry if you were using that old SunOS 4.x style mechanism, but it is now gone. ok semarie millert florian
* fix conditionalseric2015-10-081-2/+2
| | | | ok deraadt@
* Handle case where no hint is passed in. Found as a crash of fdm by jturner@deraadt2015-10-081-2/+2
|
* getaddrinfo_async() shouldn't unconditionally intialize the resolverderaadt2015-10-071-2/+5
| | | | | | via _asr_use_resolver(). If the hint specifies for AI_NUMERICHOST, create a transient lookup context which won't try to open /etc/reslov.conf ok eric guenther
* remove bogus includes of err.heric2015-09-201-2/+1
|
* remove unused static functioneric2015-09-201-18/+1
|
* Wrap <asr.h> so internal calls go direct and all the symbols are weakguenther2015-09-141-1/+2
|
* Hide all unnecessary asr / resolver related API with _ prefixes.deraadt2015-09-091-118/+21
| | | | direction & ok guenther
* Fix test against INADDR_LOOPBACKjca2015-08-161-2/+2
| | | | ok gilles@
* fix a possible off-by-one when reading /etc/hosts if it doesn't enderic2015-05-291-3/+3
| | | | | | with a newline. ok jca@
* simply use _PATH_HOSTS where appropriateeric2015-05-261-2/+2
|
* Kill outdated comment.jca2015-05-251-2/+2
| | | | ok eric@
* Skip search domains iteration if RES_DNSRCH and/or RES_DEFNAMES is unset.eric2015-05-251-2/+6
| | | | | prodded by Brad ok jca@
* AI_ADDRCONFIG: skip loopback addresses, not loopback interfaces.jca2015-05-051-4/+10
| | | | | | | This is what RFC3493 suggests. Fixes AI_ADDRCONFIG on setups where global addresses are configured only on loopback interfaces. Discussed with and ok eric@ gilles@
* Move the AI_ADDRCONFIG setup to its own function.jca2015-05-051-18/+41
| | | | Input from and ok gilles@ eric@
* Limit AI_ADDRCONFIG effects to DNS queries.jca2015-02-141-17/+16
| | | | | | | | | This is what RFC 2553 initially described, sadly RFC 3493 stopped limiting scope to DNS. This can result in nonsensical failures with loopback addresses, link-local addresses, raw addresses and /etc/hosts entries. with and ok eric@ sperreault@
* fix a possible NULL-deref when trying to deref ifa->ifa_addrgilles2015-01-301-1/+3
| | | | ok eric@
* change _yp_domain[] to HOST_NAME_MAX+1, and re-arrange those who includederaadt2015-01-141-7/+9
| | | | it to get limits.h early enough
* Nuke some obvious #include duplications.krw2014-11-181-2/+1
| | | | ok espie@ deraadt@ millert@ tedu@
* When fopen()ing internal to libc (the API doesn't support the useguenther2014-09-151-2/+2
| | | | | | | of the resulting FILE *), then pass fopen() the 'e' mode letter to mark it close-on-exec. ok miod@
* Make queries using the search list for hostname lookups fail witheric2014-07-231-1/+7
| | | | | | | | | | NO_DATA/EAI_NODATA when the hostname param is an empty string. So far, they were using the entries in the search list with no additional component, which is not really expected. reported by jsing@ and a few others ok deraadt@, "makes sense" jsing@
* remove warning by adding explicit parentheses around && within ||chl2014-05-101-4/+4
| | | | ok sperreault@
* Implement AI_ADDRCONFIGsperreault2014-04-281-2/+39
| | | | | | | | | | | | | | | | | | | | This is a getaddrinfo() flag that is defined thusly in RFC 3493: If the AI_ADDRCONFIG flag is specified, IPv4 addresses shall be returned only if an IPv4 address is configured on the local system, and IPv6 addresses shall be returned only if an IPv6 address is configured on the local system. The loopback address is not considered for this case as valid as a configured address. For example, when using the DNS, a query for AAAA records should occur only if the node has at least one IPv6 address configured (other than IPv6 loopback) and a query for A records should occur only if the node has at least one IPv4 address configured (other than the IPv4 loopback). The flag is set by default when hints is NULL. ok Eric Faurot, Jason McIntyre
* Make the asr API public. Install asr.h to /usr/include.h and manpages.eric2014-03-261-2/+4
| | | | | | Include tweaks suggested by mpi@ ok deraadt@
* Cleanup and simplify the API to be exposed. Use better names foreric2014-03-251-21/+22
| | | | | | structures, functions and defines. discussed with and ok deraadt@ guenther@
* prefix structure names to avoid ambiguity and possible collisions wheneric2014-03-141-6/+6
| | | | | | the API gets public. ok deraadt@
* fix support for HOSTALIASES.eric2014-03-031-14/+12
| | | | | reported by tedu@ ok tedu@ deraadt@
* need more #include files for resolv.h, for the non-YP case, which happensderaadt2014-02-261-1/+3
| | | | | on the install media... ok eric
* Do not restrict chars in dname during label expansion, but validate resultingeric2014-02-261-10/+3
| | | | | | hostnames before returning them to the caller. ok deraadt@
* Better search strategy for getaddrinfo. The address family loop musteric2014-02-171-14/+161
| | | | be done "inside" the search domain loop, not the other way round.
* Make some symbols static and prefix all visible symbols with asr_eric2013-07-121-12/+12
| | | | | | to prevent collisions with third-party programs. suggested by sthen@, ok theo@
* Make hostaliases work for gethostbyname() and getaddrinfo() wheneric2013-06-011-5/+15
| | | | | | looking into /etc/hosts. Remove the alias check from the search domain iteration. Instead, take a shortcut to res_query_async_ctx() in res_search_async_ctx().
* Do not take external buffers for storing DNS responses in the internaleric2013-04-301-3/+3
| | | | | async API. That is actually useless and it makes the code more complicated. The required buffers are always allocated when needed.
* copy input flags in result addrinfo structures.eric2013-04-301-1/+2
|
* Comply with rfc2553. lib/libc/net/getaddrinfo.c already has this right.chrisz2013-04-081-2/+2
| | | | | | This fixes hostname resolution for OpenVPN 2.3.1. ok eric@.
* space cleanup; ok ericderaadt2013-04-011-3/+3
|
* allow "0" as service name for raw sockets.eric2013-03-301-2/+2
| | | | ok sthen@ bluhm@
* accept and use any protocol specified by the caller.eric2013-03-281-14/+10
| | | | issue spotted by naddy@
* Only use the search domains for DNS lookups, as the current resolver does.eric2013-03-271-38/+27
| | | | | Better not diverge too much in behavior at this point. Typo fix and doc update while there.
* knferic2012-11-241-23/+22
|
* make separate structures for pack and unpackeric2012-11-241-3/+3
|
* include yp headers if necessary.eric2012-09-061-2/+8
| | | | remove unused variable.