summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/name6.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r305144ache2016-09-051-1/+1
| | | | | | | | 'addrlen' does not matter when we need to find the first non-zero bit in the byte from the left and 'addrlen' already counted in 'lim'. PR: 212121 Submitted by: Herbie.Robinson@stratus.com
* MFC r305133ache2016-09-031-0/+19
| | | | | Apply the same qsort() usage fix as in r304911 getaddrinfo.c qsort() can't be stabilized with just return(-1) alone.
* Don't call free_addrselectpolicy(&policyhead) before policyhead has beentruckman2016-05-161-1/+0
| | | | | | | initialized. Reported by: Coverity CID: 1018727
* libc: spelling fixes.pfg2016-04-301-2/+2
| | | | Mostly on comments.
* libc: use our roundup2/rounddown2() macros when param.h is available.pfg2016-04-201-2/+3
| | | | | rounddown2 tends to produce longer lines than the original code but still it makes the code more readable.
* libc: make some more use of the nitems() macro.pfg2016-04-161-2/+2
| | | | | | | | We have an nitems() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Given that it is available already without adding additional headers and other parts of libc already use it, extend a bit more its use.
* Use _map_v4v6_address().ume2015-12-211-4/+3
| | | | MFC after: 1 week
* Stop including if_var.h from userland.glebius2015-04-061-1/+0
| | | | Sponsored by: Nginx, Inc.
* libc: Use SOCK_CLOEXEC for various internal file descriptors.jilles2013-09-061-2/+3
| | | | | | | This change avoids undesirably passing some internal file descriptors to a process created (fork+exec) by another thread. Kernel support for SOCK_CLOEXEC was added in r248534, March 19, 2013.
* Remove the advertising clause from the Regents of the University ofemaste2013-05-281-5/+1
| | | | California's license, per the letter dated July 22, 1999.
* Re-enable ip6addrctl support but only for IPv6 address.ume2013-01-101-7/+5
| | | | | Requested by: Ben Morrow <ben__at__morrow.me.uk> MFC after: 1 week
* Disable destination address selection support ofume2013-01-091-0/+8
| | | | | | | | getipnodebyname(1). RFC 2553 mentions IPv6 addresses are returned 1st. Spotted by: uqs MFC after: 1 week
* Eliminate two cases of unwanted strncpy(). The name is not requireddelphij2012-04-021-2/+0
| | | | | | | | by the current code, and the results would get overwritten anyway by subsequent memset(). Reviewed by: ume MFC after: 1 month
* - Getipnodebyname() and getipnodebyaddr() reimplemented throughbushman2007-07-311-1387/+72
| | | | | | gethostbyname() and gethostbyaddr() accordingly Approved by: re (kensmith), brooks (mentor)
* Fix build w/o INET6.yar2006-07-261-0/+2
| | | | Submitted by: Andre Albsmeier <Andre.Albsmeier siemens com>
* stop use of mutex lock in ICMP lookup.ume2006-07-231-18/+5
| | | | MFC after: 1 week
* - draft-ietf-ipngwg-icmp-namelookups-09ume2006-07-211-79/+164
| | | | | | | | | - make it compilable It still requires root privilege and is experimental. Obtained from: KAME MFC after: 1 week
* - Extend the nsswitch to support Services, Protocols and Rpcume2006-04-281-0/+259
| | | | | | | | databases. - Make nsswitch support caching. Submitted by: Michael Bushkov <bushman__at__rsu.ru> Sponsored by: Google Summer of Code 2005
* - Use ANSI C prototype.ume2006-03-251-28/+14
| | | | - Remove trailing space.
* Update the resolver in libc to BIND9's one.ume2006-03-211-37/+54
| | | | | | | | | | | | | | | | | | | | | | 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)
* The KAME's getipnodebyaddr() code honor the MULTI_PTRS_ARE_ALIASESume2005-11-151-0/+1
| | | | | | | | | define also, but res_config.h was not included into libc/net/name6.c. So getipnodebyaddr() ignored the multiple PTRs. PR: kern/88241 Submitted by: Dan Lukes <dan__at__obluda.cz> MFC after: 3 days
* reduce cast.ume2005-05-271-3/+3
| | | | MFC after: 1 week
* 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.
* raise readability bit.ume2005-05-131-7/+7
|
* the 3rd argument of getsockname() should be socklen_t*.ume2005-05-021-1/+2
| | | | Submitted by: stefanf
* oops, we don't need previous change.ume2005-05-011-8/+4
|
* make it compilable without YP definition.ume2005-05-011-5/+9
|
* we don't need mutex lock to call _gethostbynis*(), anymore.ume2005-04-281-10/+2
|
* _gethostbynis{addr,name}() can handle an IPv6, now.ume2005-04-281-16/+11
|
* hide implementation specific internal functions from netdb.h.ume2005-04-271-0/+1
| | | | it is needed to make get{host,net}by*() thread-safe.
* - nuke deprecated and unused getnodeby(3).ume2005-04-191-31/+0
| | | | | | - remove unused variable. Obtained from: KAME
* unbreak build without YP defined.ume2005-04-091-0/+4
| | | | Submitted by: Andrea Campi <andrea+freebsd_cvs_at_webcom.it>
* - we are no longer shareing any resources to be locked betweenume2005-04-061-17/+6
| | | | | | getaddrinfo(3) and getipnodeby*(3). - use definitions in reentrant.h. - remove obsolete comment.
* add missing mutex unlock.ume2005-04-051-0/+1
|
* nuke the logic for AF_UNSPEC and simplify. once, it was introducedume2005-04-021-301/+47
| | | | | to improve getaddrinfo(3). but, it is not needed for a long time since getaddrinfo(3) became providing its own res_*N() functions.
* make _getipnodebyname_multi() static.ume2005-01-271-1/+1
|
* now e.f.f.3.ip6.arpa is delegated, we no longer need to query ip6.intume2004-07-211-1/+1
| | | | Obtained from: KAME
* use source address as a hint to determine destination addressume2004-06-021-50/+361
| | | | by getipnodebyname().
* Add a missing "*errp = h_errno" forgotten in rev 1.36.pb2004-04-061-1/+2
|
* Fix _dns_ghbyname() to return NS_TRYAGAIN instead of NS_NOTFOUNDpb2004-04-051-4/+12
| | | | | | | | | on temporary nameserver failure. This is necessary to get getipnodebyname(3) to correctly return h_errno=TRY_AGAIN instead of HOST_NOT_FOUND. Reviewed by: green, thomas MFC after: 1 week
* Make the resolver(3) and many associated interfaces much more reentrant.green2004-02-251-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 support for getipnodebyname(3).ume2004-02-201-1/+225
| | | | | though getipnodebyname(3) is obsoleted api, some major applications such as Mozilla are still using it. so, it will help ipv4 users.
* Replace use of a spinlock with a mutex.deischen2003-05-041-6/+5
|
* Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' bynectar2003-04-241-2/+2
| | | | | | namespace.h. Sponsored by: DARPA, Network Associates Laboratories
* Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).nectar2003-02-161-4/+2
| | | | | | | Only warnings that could be fixed without changing the generated object code and without restructuring the source code have been handled. Reviewed by: /sbin/md5
* query ip6.arpa then ip6.int for IPv6 reverse lookup. follows RFC3152.ume2002-10-231-51/+77
| | | | | Obtained from: KAME MFC after: 1 week
* Put giant locks due to make getaddrinfo(), getnameinfo()ume2002-10-061-0/+19
| | | | | | | | | | and getipnodeby*() thread-safe. Our res_*() is not thread-safe. So, we share lock between getaddrinfo() and getipnodeby*(). Still, we cannot use getaddrinfo() and getipnodeby*() in conjunction with other functions which call res_*(). Requested by: many people
* Allocate 64K recieve buffer for DNS responses.ume2002-09-161-27/+48
|
* Check for truncation in calls to res_send/res_query/res_search.nectar2002-09-151-4/+10
| | | | Fail when it is detected.
* Backout the increase of MAXPACKET from 1024 to 65536: itnectar2002-09-151-1/+5
| | | | | | broke pthreads. Reported by: mbr, tjr
OpenPOWER on IntegriCloud