History log of /freebsd-10.1-release/lib/libc/net/getaddrinfo.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 268216 03-Jul-2014 ume

MFC r267912, r267915:
- Exclude loopback address rather than loopback interface.
- style(9)

Spotted by: melifaro


# 268051 30-Jun-2014 ume

MFC r267800:
Exclude IPv4 address from doing longest match.
It prevented DNS based load balancing.


# 267874 25-Jun-2014 ume

MFC r267616, 267640:

Retooling addrconfig() to exclude addresses on loopback interfaces
when looking for configured addresses.
This change is based upon the code from the submitter, and made
following changes:
- Exclude addresses assigned on interfaces which are down, like NetBSD
does.
- Exclude addresses assigned on interfaces which are ifdisabled.

Use SOCK_CLOEXEC.

PR: 190824
Submitted by: Justin McOmie


# 265946 13-May-2014 kevlo

MFC r264212,r264213,r264248,r265776,r265811,r265909:

- Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks.
Tested with vlc and a test suite [1].
[1] http://www.erg.abdn.ac.uk/~gerrit/udp-lite/files/udplite_linux.tar.gz

Reviewed by: jhb, glebius, adrian

- Fix a logic bug which prevented the sending of UDP packet with 0 checksum.

- Disable TX checksum offload for UDP-Lite completely. It wasn't used for
partial checksum coverage, but even for full checksum coverage it doesn't
work.


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 255328 06-Sep-2013 jilles

libc: Use SOCK_CLOEXEC for various internal file descriptors.

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.


# 254700 23-Aug-2013 jilles

libc: Make various internal file descriptors from fopen() close-on-exec.


# 238599 18-Jul-2012 emax

Return zero from get_addrselectpolicy() when no source-address-selection
policy is installed.

MFC after: 1 week


# 238504 15-Jul-2012 jilles

libc: Remove some unused strings from getaddrinfo().


# 236695 06-Jun-2012 dim

Fix two warnings about self-assignment in libc. These normally only
trigger with clang, when you either use -save-temps, or ccache.

Reported by: Sevan / Venture37 <venture37@gmail.com>
MFC after: 3 days


# 233770 02-Apr-2012 delphij

Eliminate two cases of unwanted strncpy(). The name is not required
by the current code, and the results would get overwritten anyway
by subsequent memset().

Reviewed by: ume
MFC after: 1 month


# 229766 07-Jan-2012 ume

Handle the internal scope address representation of the KAME IPv6
stack for the node-local multicast address.

Spotted by: Rainer Bredehorn <Bredehorn__at__gmx.de>
MFC after: 1 week


# 190525 29-Mar-2009 ume

Query DNS only once per an address family.

Obtained from: KAME
MFC after: 2 weeks


# 190416 25-Mar-2009 ume

Add support for SCTP to getaddrinfo(3).
Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and
IPPROTO_SCTP. It confuses some programs. If getaddrinfo(3) returns
IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at
least Apache doesn't work. So, I made getaddrinfo(3) to return
IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified
explicitly by hints.ai_protocol.

PR: bin/128167
Submitted by: Bruce Cran <bruce__at__cran.org.uk> (partly)
MFC after: 2 week


# 190382 24-Mar-2009 ume

getaddrinfo(3) should accept numeric when ai_socktype is not
specified in hint or hints is NULL.

PR: bin/51827
Submitted by: Mark Andrews <marka__at__isc.org>
MFC after: 1 week


# 188316 08-Feb-2009 ume

Shutup warning for DNAME RR.

PR: bin/127591
Submitted by: "Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv>
MFC after: 1 week


# 175955 03-Feb-2008 ume

Remove incomplete support of AI_ALL and AI_V4MAPPED.

Reported by: "Heiko Wundram (Beenic)" <wundram__at__beenic.net>


# 172052 05-Sep-2007 jinmei

ensure the head entry of addrinfo chain has non-NULL ai_canonname to be
compliant with RFC3493.

PR: standards/114910
Approved by: ume (mentor)
Approved by: re
MFC after: 1 week


# 160593 23-Jul-2006 ume

do not overload the port number on to the return value of
str2number(). this could result in an unexpected code path.

Obtained from: KAME
MFC after: 1 week


# 160577 22-Jul-2006 ume

remove obsolete comments.

MFC after: 3 days


# 160553 21-Jul-2006 ume

simplification in explore_numeric: unified the post-process with
GET_AI and GET_PORT. Commented on an impossible case.

Obtained from: KAME
MFC after: 1 week


# 160552 21-Jul-2006 ume

RFC3493 requires use of inet_aton for AF_INET.

Obtained from: KAME
MFC after: 1 week


# 160551 21-Jul-2006 ume

clean-up: rewrote explore_null and explore_numeric without using sentinel.
we do not need it since we make (at most) a single addrinfo entry in these
cases.

Obtained from: KAME
MFC after: 1 week


# 158115 28-Apr-2006 ume

- Extend the nsswitch to support Services, Protocols and Rpc
databases.
- Make nsswitch support caching.

Submitted by: Michael Bushkov <bushman__at__rsu.ru>
Sponsored by: Google Summer of Code 2005


# 157371 01-Apr-2006 ume

fix indent.


# 157203 28-Mar-2006 ume

If the query choked with EDNS0, retry without EDNS0.

Obtained from: res_nquery() of BIND9.


# 157119 25-Mar-2006 ume

- Use ANSI C prototype.
- Remove trailing space.


# 157093 24-Mar-2006 ume

When res_nquerydomain() returns SERVFAIL, we should try next domain.


# 157081 24-Mar-2006 ume

When res_send() fails, we should reserve an error code.


# 156960 21-Mar-2006 ume

Update the resolver in libc to BIND9's one.

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)


# 156946 21-Mar-2006 delphij

When we are doing initialization against q, use its own size, not
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>


# 156155 01-Mar-2006 ume

Handle the errors returned by res_querydomain() in same manner.

Reported by: yar
Tested by: yar, Rostislav Krasny <rosti.bsd__at__gmail.com>
MFC after: 1 week


# 155983 24-Feb-2006 ume

- Just query 'as is', if there is a trailing dot in the name.
- 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


# 148308 22-Jul-2005 ume

Remove padding for ABI compatibility of ai_addrlen member
from struct addrinfo. This change break ABI compatibility
on 64 bit arch.


# 146244 15-May-2005 ume

- The ai_addrlen of a struct addrinfo used to be a size_t, per
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


# 146222 14-May-2005 gnn

Submitted by: Jinmei Tatuya, Hajimu Umemoto
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.


# 146190 13-May-2005 ume

free ypbuf only when yp_match() succeed.


# 145786 02-May-2005 ume

the 3rd argument of getsockname() should be socklen_t*.

Submitted by: stefanf


# 145118 15-Apr-2005 ume

Now, our getservbyname(3) is thread-safe. So, we don't need
to protect it with mutex lock.


# 145113 15-Apr-2005 ume

hostalias() is not thread-safe. So, introduce _res_hostalias()
and use it.

Obtained from: BIND9


# 145066 14-Apr-2005 ume

remove needless res_init() call.

Inspired by: NetBSD


# 144715 06-Apr-2005 ume

- we are no longer shareing any resources to be locked between
getaddrinfo(3) and getipnodeby*(3).
- use definitions in reentrant.h.
- remove obsolete comment.


# 144708 06-Apr-2005 ume

separate gai_strerror(3) from getaddrinfo.c.

Requested by: phantom


# 144679 05-Apr-2005 ume

make yp stuff re-entrant.

Obtained from: NetBSD


# 144634 04-Apr-2005 ume

make _files_getaddrinfo() re-entrant.

Obtained from: NetBSD


# 141908 14-Feb-2005 phantom

. Convert return type of gai_strerror() to 'const char *' as POSIX requires.
. Convert ai_errlist[] to simple 'char *' array, and appropriately
optimize gai_strerror()


# 140947 28-Jan-2005 ume

use strdup().

Obtained from: KAME
MFC after: 1 week


# 140908 27-Jan-2005 ume

implement AI_NUMERICSERV (as defined in RFC3493).

Obtained from: KAME
MFC after: 1 week


# 140906 27-Jan-2005 ume

fill ai_canonname field for numeric hostname, by the given hostname.
follow new recommendation in RFC3493.

Obtained from: KAME
MFC after: 1 week


# 140896 27-Jan-2005 ume

query A RR before AAAA RR.

MFC after: 1 week


# 139612 03-Jan-2005 sobomax

Don't ignore the last line of config file (/etc/hosts, /etc/services, etc)
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


# 130600 16-Jun-2004 ume

Rename variable name from `name' to `hostname'.
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>


# 129905 31-May-2004 ume

Treat IPv4 private address as global scope rather than site scope.
Though it breaks RFC 3484, without this change, dest addr selection
doesn't work well under NAT environment.


# 129901 31-May-2004 ume

use source address as a hint to determine destination address.

Obtained from: KAME


# 126243 25-Feb-2004 green

Make the resolver(3) and many associated interfaces much more reentrant.
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.


# 121747 30-Oct-2003 ume

add destination address selection described in RFC3484.
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


# 121474 24-Oct-2003 ume

oops, revert previous change to getaddrinfo.c. This is not related
to RFC3493. The previous change was related to RFC3484 (Default
Address Selection for IPv6), and it will come later.


# 121472 24-Oct-2003 ume

Switch Advanced Sockets API for IPv6 from RFC2292 to RFC3542
(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


# 121426 23-Oct-2003 ume

reorder functions to be in sync with KAME.


# 121425 23-Oct-2003 ume

EAI_ADDRFAMILY and EAI_NODATA was deprecated in RFC3493
(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


# 121348 22-Oct-2003 ume

oops, gai_strerror must return default value when error code
isn't found in ai_errlist.


# 121347 22-Oct-2003 ume

make ai_errlist struct. this is preparation for RFC3493
(EAI_NODATA is depricated).

Obtained from: KAME


# 114681 04-May-2003 deischen

Replace use of a spinlock with a mutex.


# 114443 01-May-2003 nectar

Back out the `hiding' of strlcpy and strlcat. Several people
vocally objected to this safety belt.


# 114256 29-Apr-2003 nectar

`Hide' strlcpy and strlcat (using the namespace.h / __weak_reference
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


# 113976 24-Apr-2003 nectar

Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' by
namespace.h.

Sponsored by: DARPA, Network Associates Laboratories


# 111618 27-Feb-2003 nectar

Eliminate 19 warnings in libc (at level WARNS=2) of the
`implicit declaration of function' variety.


# 105943 25-Oct-2002 ume

- scopeid is u_int32_t
- strtoul pedant. pointed out by deraadt

Obtained from: KAME
MFC after: 1 week


# 105940 25-Oct-2002 ume

- kill strcpy
- port range check need to be done before htons. from deraadt
- %d/%u audit
- correct bad practice in the code - it uses two changing variables
to manage buffer (buf and buflen). we eliminate buflen and use
fixed point (ep) as the ending pointer.
- use snprintf, not sprintf
- pass correct name into q.name. from lukem@netbsd
- sync comment

Obtained from: KAME
MFC after: 1 week


# 104558 06-Oct-2002 ume

Put giant locks due to make getaddrinfo(), getnameinfo()
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


# 103357 15-Sep-2002 ume

Allocate 64K recieve buffer for DNS responses.
KAME did the modification only to _dns_getaddrinfo(). However,
it is not sufficient, and res_queryN() should be modified, too.
So, I did same modification to res_queryN().

Obtained from: KAME


# 103350 15-Sep-2002 nectar

Check for truncation in calls to res_send/res_query/res_search.
Fail when it is detected.


# 103335 15-Sep-2002 nectar

Backout the increase of MAXPACKET from 1024 to 65536: it
broke pthreads.

Reported by: mbr, tjr


# 103307 13-Sep-2002 nectar

When using res_send/res_query/res_search, the caller must either
insure enough space is available for the response, or be prepared
to resize the buffer and retry as necessary.

Do the conservative thing and make sure enough space is available.

Reviewed by: silence on freebsd-audit


# 102237 21-Aug-2002 pirzyk

Fixed getaddrinfo to honor sortlist in /etc/resolv.conf

PR: bin/27939
Reviewed by: ru, sheldonh (about a year ago)
Obtained from: ume (via KAME, I think)
MFC after: 1 month


# 101221 02-Aug-2002 mux

Remove an #include <syslog.h>. It's already included conditionally
above, as it should be.

Submitted by: Olivier Houchard <cognet@ci0.org>


# 92986 22-Mar-2002 obrien

Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.


# 92941 22-Mar-2002 obrien

Remove multi-line __P() usage.


# 92905 21-Mar-2002 obrien

Remove __P() usage.


# 90273 05-Feb-2002 alfred

balance parens.

Submitted by: mbr


# 90271 05-Feb-2002 alfred

Fix cc -Wall, fix rcsid warnings, add missing prototypes,
change prototypes to be the same as in the original sun tirpc code.
Remove ()P macro in a file where the mayority had ()P already removed.
Add them if the mayority use ()P macros.

Submitted by: mbr
Requested by: bde


# 90053 01-Feb-2002 roam

Return ENONAME if getaddrinfo() is called with AI_NUMERICHOST
and the hostname given is not numeric.

PR: 34390
Submitted by: Serge van den Boom <svdb@stack.nl>
Approved by: silence from -net
MFC after: 1 month


# 78012 10-Jun-2001 ume

Implement EDNS0 support, as EDNS0 support will be made mandatory for
IPv6 transport-ready resolvers/DNS servers. Need careful configuration
when enable it. (default config is not affected).
See manpage for details.

XXX visible symbol __res_opt() is added, however, it is not supposed to be
called from outside, libc minor is not bumped.

Obtained from: KAME/NetBSD


# 74393 17-Mar-2001 ume

Nuke non-standard EAI_RESNULL.


# 73665 05-Mar-2001 obrien

Fix style that got corrupted.


# 73663 05-Mar-2001 obrien

Fix FreeBSD id style breakage from rev 1.17


# 72693 19-Feb-2001 ume

Enable AI_ADDRCONFIG as a valid flag of getaddrinfo(3). Some
applications specify AI_ADDRCONFIG and fail to run under FreeBSD.
Latest mews is known. Now, getaddrinfo(3) behaves according to
AI_ADDRCONFIG.


# 71579 24-Jan-2001 deischen

Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions. If the threads library is linked in, the real
pthread functions will pulled in.

Use the following convention for system calls wrapped by the
threads library:
__sys_foo - actual system call
_foo - weak definition to __sys_foo
foo - weak definition to __sys_foo

Change all libc uses of system calls wrapped by the threads
library from foo to _foo. In order to define the prototypes
for _foo(), we introduce namespace.h and un-namespace.h
(suggested by bde). All files that need to reference these
system calls, should include namespace.h before any standard
includes, then include un-namespace.h after the standard
includes and before any local includes. <db.h> is an exception
and shouldn't be included in between namespace.h and
un-namespace.h namespace.h will define foo to _foo, and
un-namespace.h will undefine foo.

Try to eliminate some of the recursive calls to MT-safe
functions in libc/stdio in preparation for adding a mutex
to FILE. We have recursive mutexes, but would like to avoid
using them if possible.

Remove uneeded includes of <errno.h> from a few files.

Add $FreeBSD$ to a few files in order to pass commitprep.

Approved by: -arch


# 65532 06-Sep-2000 nectar

Add nsswitch support. By creating an /etc/nsswitch.conf file, you can
configure FreeBSD so that various databases such as passwd and group can be
looked up using flat files, NIS, or Hesiod.

= Hesiod has been added to libc (see hesiod(3)).

= A library routine for parsing nsswitch.conf and invoking callback
functions as specified has been added to libc (see nsdispatch(3)).

= The following C library functions have been modified to use nsdispatch:
. getgrent, getgrnam, getgrgid
. getpwent, getpwnam, getpwuid
. getusershell
. getaddrinfo
. gethostbyname, gethostbyname2, gethostbyaddr
. getnetbyname, getnetbyaddr
. getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr

= host.conf has been removed from src/etc. rc.network has been modified
to warn that host.conf is no longer used at boot time. In addition, if
there is a host.conf but no nsswitch.conf, the latter is created at boot
time from the former.

Obtained from: NetBSD


# 63704 21-Jul-2000 jasone

Use _close() instead of close() in addrconfig() to keep it from becoming a
potential cancellation point in libc_r.


# 62836 09-Jul-2000 itojun

reject empty scopeid. use strtoul() for checking all-numericness of
portname. explicitly reject empty numeric portname.
sync with kame. based on comments from itohy@netbsd.org


# 62614 05-Jul-2000 itojun

sync with kame.
- better return code. from enami@netbsd
- do not use "class" as variable name. C++ guy had trouble with it.


# 61877 20-Jun-2000 ume

Don't call _getipnodebyname_multi(). It fixes the problem that
getaddrinfo() accidentally returns IPv4 mapped IPv6 address instead
of native IPv4 address.
Now, getaddinfo() is scoped address ready. You can put scoped
address within /etc/hosts.

Obtained from: KAME Project.


# 59411 20-Apr-2000 shin

Change getaddrinfo() resolve order
from
all AAAA trial, then all A trial
to
try AAAA and A for each trial

TODO: more fix for the case where IPv4 mapped IPv6 addr is disabled

Reviewed by: ume


# 57340 19-Feb-2000 shin

Change IPv6 scoped addr format again based on recent standard discussion.
Sorry for the flapping, but no change will be done for 4.0 anymore.
Official standard will be published around April or later.
If different format would be adopted at that time, then support for
the new format will be added to the succeeding FreeBSD 4.x.

Approved by: jkh


# 57107 10-Feb-2000 shin

Let getaddrinfo() and related functions supports traditional IPv4 format
(shortend format, etc)

Current KAME getaddrinfo() supports only d.d.d.d format IPv4
addr. But traditionally inet_aton() and etc support other formats.
(shortend format and octal/deciaml/hex format)
Aboud this,
-As far as the discussion on freebsd-current, many people
think traditional format should also be supported by getaddrinfo().
-X/Open spec requires getaddrinfo() also support those
traditional IPv4 format.
-RFC2553 say nothing about it.
-As the result of confirmation in ietf/ipng list, there is
no clear concensus yet, and the reply was, "RFC2553 update
and X/Open spec will be in sync"

So takeing these conditions into account, I think
getaddrinfo() should also support traditional IPv4 format.

Specified by: Marc Schneiders <marc@oldserver.demon.nl>
Approved by: jkh


# 57069 08-Feb-2000 shin

IPv6 scoped addr format is changed as recent KAME change.

KAME scoped addr format is changed recently.
before: addr@scope
now: scope%addr

Because the end of IPv6 numeric addr is tend to be truncated in
`netstat -rn ` output, so placing scope part at starting of addr
will be convenient.

Approved by: jkh

Obtained from: KAME project


# 56698 27-Jan-2000 jasone

Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo(). In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate. In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().

Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().

Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().

Make thread cancellation fully POSIX-compliant.

Suggested by: deischen


# 56627 26-Jan-2000 shin

Fix getaddrinfo() behaviour to be more compliant with RFC2553. Patches are
obtained from itojun.
-don't filter address families which are not supported by system at
FQDN resolving.
-don't do reverse lookup

I think I checked all lib and tools which use getaddrinfo() if
this change affect them.

Obtained from: KAME project


# 55876 13-Jan-2000 shin

added IPv4 mapped IPv6 addr consideration for getaddrinfo() reverse lookup case


# 55837 12-Jan-2000 jasone

Add three-tier symbol naming in support of POSIX thread cancellation
points. For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep(). The arrows represent weak aliases. For
system calls, the pattern is _read() <-- _libc_read() <-- read().


# 55167 28-Dec-1999 shin

Small bug fix and improvements
(1)added error check of if_nameindex() return value at getaddrinfo().
(2)print out more detailed information when getaddrinfo() error value
is EAI_SYSTEM.(in this case system error num is kept in errno)

(1) is Discovered by: jinmei@kame.net in KAME environment.


# 55163 28-Dec-1999 shin

Getaddrinfo(), getnameinfo(), and etc support in libc/net.
Several udp and raw apps IPv6 support.

Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project