summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/getaddrinfo.c
Commit message (Collapse)AuthorAgeFilesLines
* do not overload the port number on to the return value ofume2006-07-231-8/+9
| | | | | | | str2number(). this could result in an unexpected code path. Obtained from: KAME MFC after: 1 week
* remove obsolete comments.ume2006-07-221-8/+0
| | | | MFC after: 3 days
* simplification in explore_numeric: unified the post-process withume2006-07-211-32/+22
| | | | | | | GET_AI and GET_PORT. Commented on an impossible case. Obtained from: KAME MFC after: 1 week
* RFC3493 requires use of inet_aton for AF_INET.ume2006-07-211-3/+7
| | | | | Obtained from: KAME MFC after: 1 week
* clean-up: rewrote explore_null and explore_numeric without using sentinel.ume2006-07-211-35/+20
| | | | | | | | we do not need it since we make (at most) a single addrinfo entry in these cases. Obtained from: KAME MFC after: 1 week
* - Extend the nsswitch to support Services, Protocols and Rpcume2006-04-281-0/+197
| | | | | | | | databases. - Make nsswitch support caching. Submitted by: Michael Bushkov <bushman__at__rsu.ru> Sponsored by: Google Summer of Code 2005
* fix indent.ume2006-04-011-9/+9
|
* If the query choked with EDNS0, retry without EDNS0.ume2006-03-281-8/+24
| | | | Obtained from: res_nquery() of BIND9.
* - Use ANSI C prototype.ume2006-03-251-104/+38
| | | | - Remove trailing space.
* When res_nquerydomain() returns SERVFAIL, we should try next domain.ume2006-03-241-1/+9
|
* When res_send() fails, we should reserve an error code.ume2006-03-241-2/+2
|
* Update the resolver in libc to BIND9's one.ume2006-03-211-75/+83
| | | | | | | | | | | | | | | | | | | | | | Since, res_sendsigned(3) and the friends use MD5 functions, it is hard to include them without having MD5 functions in libc. So, res_sendsigned(3) is not merged into libc. Since, res_update(3) in BIND9 is not binary compatible with our res_update(3), res_update(3) is leaved as is, except some necessary modifications. The res_update(3) and the friends are not essential part of the resolver. They are not defined in resolv.h but defined in res_update.h separately in BIND9. Further, they are not called from our tree. So, I hide them from our resolv.h, but leave them only for binary backward compatibility (perhaps, no one calls them). Since, struct __res_state_ext is not exposed in BIND9, I hide it from our resolv.h. And, global variable _res_ext is removed. It breaks binary backward compatibility. But, since it is not used from outside of our libc, I think it is safe. Reviewed by: arch@ (no objection)
* When we are doing initialization against q, use its own size, notdelphij2006-03-211-1/+1
| | | | | | | the size of q2. This should be a no-op because q and q2 are of the same type. Submitted by: Alexey Dobriyan <adobriyan gmail com>
* Handle the errors returned by res_querydomain() in same manner.ume2006-03-011-0/+20
| | | | | | Reported by: yar Tested by: yar, Rostislav Krasny <rosti.bsd__at__gmail.com> MFC after: 1 week
* - Just query 'as is', if there is a trailing dot in the name.ume2006-02-241-9/+20
| | | | | | | | | | - Don't query 'as is' twice. PR: bin/62139 Reported by: Rostislav Krasny <rosti.bsd__at__gmail.com> Tested by: Rostislav Krasny <rosti.bsd__at__gmail.com> Obtained from: BIND9 (with some modification) MFC after: 1 week
* Remove padding for ABI compatibility of ai_addrlen memberume2005-07-221-3/+0
| | | | | from struct addrinfo. This change break ABI compatibility on 64 bit arch.
* - The ai_addrlen of a struct addrinfo used to be a size_t, perume2005-05-151-1/+4
| | | | | | | | | | | | | | | | RFC 2553. In XNS5.2, and subsequently in POSIX-2001 and RFC 3493, it was changed to a socklen_t. And, the n_net of a struct netent used to be an unsigned long integer. In XNS5, and subsequently in POSIX-2001, it was changed to an uint32_t. To accomodate for this while preserving ABI compatibility with the old interface, we need to prepend or append 32 bits of padding, depending on the (LP64) architecture's endianness. - Correct 1st argument of getnetbyaddr() to uint32_t on 32 bit arch. Stay as is on 64 bit arch for ABI backward compatibility for now. Reviewed by: das, peter MFC after: 2 weeks
* Submitted by: Jinmei Tatuya, Hajimu Umemotognn2005-05-141-2/+2
| | | | | | | | | | Reviewed by: rwatson at freebsd dot org Approved by: rwatson at freebsd dot org MFC after: 1 week Fix the matchlen() function so that it handles the IPv4 (AF_INET) case correctly. Until now it has been treating IPv4 addresses as if they were IPv6 which could lead to corruption errors.
* free ypbuf only when yp_match() succeed.ume2005-05-131-1/+1
|
* the 3rd argument of getsockname() should be socklen_t*.ume2005-05-021-1/+2
| | | | Submitted by: stefanf
* Now, our getservbyname(3) is thread-safe. So, we don't needume2005-04-151-14/+1
| | | | to protect it with mutex lock.
* hostalias() is not thread-safe. So, introduce _res_hostalias()ume2005-04-151-2/+3
| | | | | | and use it. Obtained from: BIND9
* remove needless res_init() call.ume2005-04-141-9/+0
| | | | Inspired by: NetBSD
* - we are no longer shareing any resources to be locked betweenume2005-04-061-10/+6
| | | | | | getaddrinfo(3) and getipnodeby*(3). - use definitions in reentrant.h. - remove obsolete comment.
* separate gai_strerror(3) from getaddrinfo.c.ume2005-04-061-27/+0
| | | | Requested by: phantom
* make yp stuff re-entrant.ume2005-04-051-26/+15
| | | | Obtained from: NetBSD
* make _files_getaddrinfo() re-entrant.ume2005-04-041-22/+19
| | | | Obtained from: NetBSD
* . Convert return type of gai_strerror() to 'const char *' as POSIX requires.phantom2005-02-141-29/+21
| | | | | . Convert ai_errlist[] to simple 'char *' array, and appropriately optimize gai_strerror()
* use strdup().ume2005-01-281-2/+1
| | | | | Obtained from: KAME MFC after: 1 week
* implement AI_NUMERICSERV (as defined in RFC3493).ume2005-01-271-10/+13
| | | | | Obtained from: KAME MFC after: 1 week
* fill ai_canonname field for numeric hostname, by the given hostname.ume2005-01-271-7/+25
| | | | | | | follow new recommendation in RFC3493. Obtained from: KAME MFC after: 1 week
* query A RR before AAAA RR.ume2005-01-271-10/+10
| | | | MFC after: 1 week
* Don't ignore the last line of config file (/etc/hosts, /etc/services, etc)sobomax2005-01-031-3/+3
| | | | | | | | which doesn't end in \n, since it may be very confusing. Also this should increase consistency, since most other config files work just fine regardless of the presence of traling \n in the last line. MFC After: 2 weeks
* Rename variable name from `name' to `hostname'.ume2004-06-161-7/+7
| | | | | | | | | | This is a corresponding change to bin/67994. I'll soon commit bin/67994 into 4-STABLE. Actually, 5-CURRENT's getaddrinfo() doesn't have the problem mentiond in bin/67994. However, it is good to be in sync variable name with 4-STABLE and KAME. PR: bin/67994 Submitted by: JINMEI Tatuya <jinmei@ocean.jinmei.org>
* Treat IPv4 private address as global scope rather than site scope.ume2004-05-311-1/+1
| | | | | Though it breaks RFC 3484, without this change, dest addr selection doesn't work well under NAT environment.
* use source address as a hint to determine destination address.ume2004-05-311-0/+111
| | | | Obtained from: KAME
* Make the resolver(3) and many associated interfaces much more reentrant.green2004-02-251-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The getaddrinfo(3), getipnodebyname(3) and resolver(3) can coincide now with what should be totally reentrant, and h_errno values will now be preserved correctly, but this does not affect interfaces such as gethostbyname(3) which are still mostly non-reentrant. In all of these relevant functions, the thread-safety has been pushed down as far as it seems possible right now. This means that operations that are selected via nsdispatch(3) (i.e. files, yp, dns) are protected still under global locks that getaddrinfo(3) defines, but where possible the locking is greatly reduced. The most noticeable improvement is that multiple DNS lookups can now be run at the same time, and this shows major improvement in performance of DNS-lookup threaded programs, and solves the "Mozilla tab serialization" problem. No single-threaded applications need to be recompiled. Multi-threaded applications that reference "_res" to change resolver(3) options will need to be recompiled, and ones which reference "h_errno" will also if they desire the correct h_errno values. If the applications already understood that _res and h_errno were not thread-safe and had their own locking, they will see no performance improvement but will not actually break in any way. Please note that when NSS modules are used, or when nsdispatch(3) defaults to adding any lookups of its own to the individual libc _nsdispatch() calls, those MUST be reentrant as well.
* add destination address selection described in RFC3484.ume2003-10-301-7/+412
| | | | | | | | | in KAME implementation, even when no policy is installed into kernel, getaddrinfo(3) sorts addresses. Since it causes POLA violation, I modified to don't sort addresses when no policy is installed into kernel, Obtained from: KAME
* oops, revert previous change to getaddrinfo.c. This is not relatedume2003-10-241-275/+155
| | | | | to RFC3493. The previous change was related to RFC3484 (Default Address Selection for IPv6), and it will come later.
* Switch Advanced Sockets API for IPv6 from RFC2292 to RFC3542ume2003-10-241-155/+275
| | | | | | | | | | (aka RFC2292bis). Though I believe this commit doesn't break backward compatibility againt existing binaries, it breaks backward compatibility of API. Now, the applications which use Advanced Sockets API such as telnet, ping6, mld6query and traceroute6 use RFC3542 API. Obtained from: KAME
* reorder functions to be in sync with KAME.ume2003-10-231-128/+132
|
* EAI_ADDRFAMILY and EAI_NODATA was deprecated in RFC3493ume2003-10-231-10/+4
| | | | | | | | (aka RFC2553bis). Now, getaddrinfo(3) returns EAI_NONAME instead of EAI_NODATA. Our getaddrinfo(3) nor getnameinfo(3) didn't use EAI_ADDRFAMILY. Obtained from: KAME
* oops, gai_strerror must return default value when error codeume2003-10-221-0/+1
| | | | isn't found in ai_errlist.
* make ai_errlist struct. this is preparation for RFC3493ume2003-10-221-19/+32
| | | | | | (EAI_NODATA is depricated). Obtained from: KAME
* Replace use of a spinlock with a mutex.deischen2003-05-041-6/+4
|
* Back out the `hiding' of strlcpy and strlcat. Several peoplenectar2003-05-011-2/+2
| | | | vocally objected to this safety belt.
* `Hide' strlcpy and strlcat (using the namespace.h / __weak_referencenectar2003-04-291-2/+2
| | | | | | | technique) so that we don't wind up calling into an application's version if the application defines them. Inspired by: qpopper's interfering and buggy version of strlcpy
* Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' bynectar2003-04-241-1/+1
| | | | | | namespace.h. Sponsored by: DARPA, Network Associates Laboratories
* Eliminate 19 warnings in libc (at level WARNS=2) of thenectar2003-02-271-1/+1
| | | | `implicit declaration of function' variety.
* - scopeid is u_int32_tume2002-10-251-14/+21
| | | | | | | - strtoul pedant. pointed out by deraadt Obtained from: KAME MFC after: 1 week
OpenPOWER on IntegriCloud