History log of /freebsd-head/lib/libc/net/gethostnamadr.c
Revision Date Author Comments
9014a6e40c74437b39c10b33618d7dfbedea2362 25-Nov-2017 pfg <pfg@FreeBSD.org> libc: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
00d578928eca75be320b36d37543a7e2a4f9fbdb 27-May-2016 grehan <grehan@FreeBSD.org> Create branch for bhyve graphics import.
69669cbe99c92053594f595bbb8afd89c18a1892 30-Apr-2016 pfg <pfg@FreeBSD.org> libc: spelling fixes.

Mostly on comments.
f7aca4b6732b0fec7e07f68e00a786539595cea1 20-Sep-2015 rodrigc <rodrigc@FreeBSD.org> Add declarations to netdb_private.h to eliminate -Wmissing-prototypes warnings.
eb1a5f8de9f7ea602c373a710f531abbf81141c4 21-Feb-2014 gjb <gjb@FreeBSD.org> Move ^/user/gjb/hacking/release-embedded up one directory, and remove
^/user/gjb/hacking since this is likely to be merged to head/ soon.

Sponsored by: The FreeBSD Foundation
6b01bbf146ab195243a8e7d43bb11f8835c76af8 27-Dec-2013 gjb <gjb@FreeBSD.org> Copy head@r259933 -> user/gjb/hacking/release-embedded for initial
inclusion of (at least) arm builds with the release.

Sponsored by: The FreeBSD Foundation
09f9c897d33c41618ada06fbbcf1a9b3812dee53 19-Oct-2010 jamie <jamie@FreeBSD.org> A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.
5fdaddea72f2485c5731c35f4288d3a1f38627d6 13-Aug-2010 ume <ume@FreeBSD.org> - When there is no room for returning the result, nss backend
have to return ERANGE and terminate with NS_RETURN.
- When gethostbyname_r(3) and the friends end with an error,
set errno to the value nss backend returns, and return errno

PR: kern/131623
MFC after: 2 weeks
f1216d1f0ade038907195fc114b7e630623b402c 19-Mar-2010 delphij <delphij@FreeBSD.org> Create a custom branch where I will be able to do the merge.
19b6af98ec71398e77874582eb84ec5310c7156f 22-Nov-2008 dfr <dfr@FreeBSD.org> Clone Kip's Xen on stable/6 tree so that I can work on improving FreeBSD/amd64
performance in Xen's HVM mode.
cf5320822f93810742e3d4a1ac8202db8482e633 19-Oct-2008 lulf <lulf@FreeBSD.org> - Import the HEAD csup code which is the basis for the cvsmode work.
ea7fc621cea3fc6afc7c501a1fd2d33f078f6d77 17-Jul-2006 ume <ume@FreeBSD.org> MFC:
- Update the resolver in libc to BIND9's one.
- make reentrant version of netdb functions glibc style API, and
expose them to outside of libc.
- make netdb functions NSS friendly.

include/Makefile 1.261
include/arpa/inet.h 1.26
include/arpa/nameser.h 1.18
include/arpa/nameser_compat.h 1.5
include/netdb.h 1.40-1.42
include/res_update.h 1.1
include/resolv.h 1.29-1.30
lib/libc/Makefile 1.64
lib/libc/include/port_after.h 1.1-1.2
lib/libc/include/port_before.h 1.1
lib/libc/inet/Makefile.inc 1.1
lib/libc/inet/inet_addr.c, 1.2
lib/libc/inet/inet_cidr_pton.c, 1.2
lib/libc/inet/inet_lnaof.c, 1.2
lib/libc/inet/inet_makeaddr.c, 1.2
lib/libc/inet/inet_net_ntop.c, 1.2
lib/libc/inet/inet_net_pton.c, 1.2
lib/libc/inet/inet_neta.c, 1.2
lib/libc/inet/inet_netof.c, 1.2
lib/libc/inet/inet_network.c, 1.2
lib/libc/inet/inet_ntoa.c, 1.2
lib/libc/inet/inet_ntop.c, 1.2
lib/libc/inet/inet_pton.c, 1.2
lib/libc/inet/nsap_addr.c, 1.2
lib/libc/isc/Makefile.inc 1.1
lib/libc/isc/ev_streams.c, 1.2
lib/libc/isc/ev_timers.c, 1.2
lib/libc/isc/eventlib_p.h, 1.2
lib/libc/nameser/Makefile.inc 1.1
lib/libc/nameser/ns_print.c, 1.2
lib/libc/nameser/ns_samedomain.c, 1.2
lib/libc/net/Makefile.inc 1.58
lib/libc/net/getaddrinfo.c 1.74, 1.77-1.78
lib/libc/net/gethostbydns.c 1.55-1.57
lib/libc/net/gethostbyht.c 1.24-1.26
lib/libc/net/gethostbyname.3 1.35
lib/libc/net/gethostbynis.c 1.26-1.28
lib/libc/net/gethostnamadr.c 1.29-1.30, 1.32
lib/libc/net/getnameinfo.c 1.18
lib/libc/net/getnetbydns.c 1.32-1.33
lib/libc/net/getnetbyht.c 1.17-1.18
lib/libc/net/getnetbynis.c 1.20-1.21
lib/libc/net/getnetnamadr.c 1.22
lib/libc/net/getproto.c 1.5
lib/libc/net/getprotoent.c 1.7
lib/libc/net/getprotoname.c 1.5
lib/libc/net/getservbyname.c 1.8
lib/libc/net/getservbyport.c 1.8
lib/libc/net/getservent.c 1.21
lib/libc/net/name6.c 1.56-1.57
lib/libc/net/netdb_private.h 1.10-1.11, 1.13
lib/libc/net/res_config.h 1.9
lib/libc/net/res_mkupdate.c 1.7-1.8
lib/libc/net/res_update.c 1.8-1.9
lib/libc/resolv/Makefile.inc 1.1
lib/libc/resolv/h_errno.c 1.1
lib/libc/resolv/herror.c, 1.2
lib/libc/resolv/mtctxres.c, 1.2
lib/libc/resolv/res_comp.c, 1.2
lib/libc/resolv/res_data.c, 1.2-1.3
lib/libc/resolv/res_debug.c, 1.2
lib/libc/resolv/res_init.c, 1.2
lib/libc/resolv/res_mkquery.c, 1.2
lib/libc/resolv/res_query.c, 1.2-1.3
lib/libc/resolv/res_send.c, 1.2
lib/libc/resolv/res_state.c 1.1-1.2

Tested by: nork
dce008dac9e1172bb4b955ae91cf29b2e8429dd2 21-May-2006 ume <ume@FreeBSD.org> Fix gethostbyaddr() prototype to conform to IEEE Std 1003.1 on 64 bit

X-MFC after: never
ab3eacdf3106cb0b4027a6d928d9555815af0b48 12-May-2006 ume <ume@FreeBSD.org> Fix gethostbyaddr() prototype to conform to IEEE Std 1003.1:


gethostbyaddr_r() is changed as well.
It breaks ABI backward compatibility on 64 bit arch. So, we fix it
on 32 bit arch only for now.

Reported by: Rostislav Krasny <rosti.bsd@gmail.com>
e14f1c3b3b31e7f6c28cef5acc87f4c7373d288c 28-Apr-2006 ume <ume@FreeBSD.org> - Extend the nsswitch to support Services, Protocols and Rpc
- Make nsswitch support caching.

Submitted by: Michael Bushkov <bushman__at__rsu.ru>
Sponsored by: Google Summer of Code 2005
b6bb84cf9e6c9d871a17bcf962cf63180af70e95 15-Apr-2006 ume <ume@FreeBSD.org> - make reentrant version of netdb functions glibc style API, and
expose them to outside of libc.
- make netdb functions NSS friendly.

Reviewed by: arch@ and current@ (no objection)
b09a8950a1301d97aef8e2975e34a3ba5bc451c3 21-Mar-2006 ume <ume@FreeBSD.org> 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)
eff8f31f8b0bffb36780a423c2307f514ac22269 30-Apr-2005 ume <ume@FreeBSD.org> oops, gethostbyaddr(3) must return h_addr as an IPv4-mapped
IPv6 address when RES_USE_INET6 was set, according to RFC 2133
section 6.2.
5acac5def141d4709680819f06b1a8c4fb8c641a 29-Apr-2005 ume <ume@FreeBSD.org> - do validation check and IPv4-mapped IPv6 address handling before
any query.
- don't query against IPv6 link-local address.
- use IN6_IS_ADDR_V4{MAPPED,COMPAT} macros.
- use memcpy() instead of bcopy().

Inspired by: NetBSD
d8dbaeb308e2bb88b0eebab250c74380781bee0a 28-Apr-2005 ume <ume@FreeBSD.org> sync _map_v4v6_host*() with bind9's. it treats align better bit.

Obtained from: BIND9
b384ad94d82a804ef207d245503de1f7d151c499 28-Apr-2005 ume <ume@FreeBSD.org> make gethostby*() thread-safe.
1dcbf1fa6d10d13dbb22aa0e0ad569b2a28c7791 27-Apr-2005 ume <ume@FreeBSD.org> hide implementation specific internal functions from netdb.h.
it is needed to make get{host,net}by*() thread-safe.
c5b4993c85e0d43326c139c8546a7620e37a6a41 25-Apr-2005 ume <ume@FreeBSD.org> ensure parsing numeric address before any host query.

Inspired by: NetBSD
5ac65c46e64b21cbadea9ac53fc4e019c8005e3e 19-Jun-2003 kris <kris@FreeBSD.org> Remove bogus non-reentrant "temporary" implementation of gethostbyaddr_r()
that has been here for 6 years and 9 months.

Reviewed by: deischen
MFC After: 1 week
e24fc5cd2114be8185898edffd1ee3cef0ad2ebe 24-Apr-2003 nectar <nectar@FreeBSD.org> Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' by

Sponsored by: DARPA, Network Associates Laboratories
d90536e35b89461c5dbefaae4921fd815b80aaf5 22-Mar-2002 obrien <obrien@FreeBSD.org> Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.
95ce4d2cdc59a8eb8cff5859ae0ba21451c4798d 13-Aug-2001 ru <ru@FreeBSD.org> Removed duplicate VCS ID tags, as per style(9).
1635c221b7b2678beeeb2b5fa728edd7c8c3735b 24-Jan-2001 deischen <deischen@FreeBSD.org> 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
c88ea413c07f20d24c85e6cc328d709417ba7074 27-Oct-2000 ume <ume@FreeBSD.org> Make RES_OPTIONS=inet6 work.
Basically PR22196, but slightly modified.

PR: bin/22196
748554442d0ac4467fdac2ce9d42006588fd4481 06-Sep-2000 nectar <nectar@FreeBSD.org> 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
b42951578188c5aab5c9f8cbcde4a743f8092cdc 02-Apr-2000 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'ALSA'.
049d5796117bb710a45520ba1f1b2ca9996e3853 04-Nov-1999 ache <ache@FreeBSD.org> Add unsigned char cast to isalpha
76f0c923fe4b2a1616453876611dc76b4f6b5355 28-Aug-1999 peter <peter@FreeBSD.org> $Id$ -> $FreeBSD$
0506343883d62f6649f7bbaf1a436133cef6261d 11-Jan-1998 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'jb'.
7c6e96080c4fb49bf912942804477d202a53396c 10-Jan-1998 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'JB'.
32ddc95d9022f09a9b44b5dec56dee6e77bb2914 25-Dec-1997 alex <alex@FreeBSD.org> Removed unnecessary initialization of hp in gethostbyaddr_r.
6b08958c64bd274652d33b6f406630fcb201cd3d 22-Feb-1997 peter <peter@FreeBSD.org> Revert $FreeBSD$ to $Id$
808a36ef658c1810327b5d329469bcf5dad24b28 14-Jan-1997 jkh <jkh@FreeBSD.org> Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.
1f1fd8028fddf809ce8077697ffa07cb30a1e5d2 29-Aug-1996 peter <peter@FreeBSD.org> Merge in bind-4.9.4-P1 resolver...
7350d1d3b2ec940c89a2b20f9d09985d9fd9e9d7 20-Aug-1996 julian <julian@FreeBSD.org> Submitted by: John Birrell <cimaxp1!jb@werple.net.au>

Here are the diffs for libc_r to get it one step closer to P1003.1c
These make most of the thread/mutex/condvar structures opaque to the
user. There are three functions which have been renamed with _np
suffixes because they are extensions to P1003.1c (I did them for JAVA,
which needs to suspend/resume threads and also start threads suspended).

I've created a new header (pthread_np.h) for the non-POSIX stuff.

The egrep tags stuff in /usr/src/lib/libc_r/Makefile that I uncommented
doesn't work. I think its best to delete it. I don't think libc_r needs
tags anyway, 'cause most of the source is in libc which does have tags.


Here's the first batch of man pages for the thread functions.
The diff to /usr/src/lib/libc_r/Makefile removes some stuff that was
inherited from /usr/src/lib/libc/Makefile that should only be done with


I should have sent this diff with the pthread(3) man page.
It allows people to type

make -DWANT_LIBC_R world

to get libc_r built with the rest of the world. I put this in the
pthread(3) man page. The default is still not to build libc_r.

The diff attached adds a pthread(3) man page to /usr/src/share/man/man3.
The idea is that without libc_r installed, this man page will give people
enough info to know that they have to build libc_r.
c4d4a99d31762beef936f34571330923e9300da9 12-Jul-1996 jkh <jkh@FreeBSD.org> General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
86f1bc4514fdcfd255f37f3218fe234bdc3664fc 05-Nov-1995 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'LINUX'.
f05428e4cd63dde97bac14b84dd146a5c00455e3 30-May-1995 rgrimes <rgrimes@FreeBSD.org> Remove trailing whitespace.
74c984e74d6e85a006418d318d5aa7b26abd8247 24-Mar-1995 ache <ache@FreeBSD.org> Change strtok() to strsep(), cause memory corruption for all
programs which use strtok() too in the same time.
Fix potential NULL reference, depends of /etc/hosts.conf format
Fix the bug when service name fetched always from beginning of the line,
not from parsed token.
2e14d9ebc3d3592c67bdf625af9ebe0dfc386653 14-Mar-1995 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'MATT_THOMAS'.
4f0d0da86d54d2621713e7d8ccfd0507888f348b 25-Sep-1994 pst <pst@FreeBSD.org> get* rework and new bind code
34cd81d75f398ee455e61969b118639dacbfd7a6 23-Sep-1994 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'MACKERRAS'.
33e047d3b0c9cdbbe20730ae94cfa32d6de3a75a 28-Aug-1994 csgr <csgr@FreeBSD.org> Fix gethostbyaddr():
call _getdnsbyaddr() instead of _getdnsbyname() ;-)
Submitted by: Geoff
d20aae3469e2d3a7d4ad92e91cd3b06c0e17c742 09-Aug-1994 wollman <wollman@FreeBSD.org> Fixed typo.
004c5a34827fa735ae1159dc312425dac0b26695 09-Aug-1994 wollman <wollman@FreeBSD.org> Add (substantially re-written) support for /etc/host.conf, and reintegrated
1.1.5 support for YP, fixing a bug in 1.1.5 that prevented YP from ever
working reliably. (I'm amazed that there were no bug reports.)

IWBRNI someone could write a host.conf(5) manual page. Please look at
the code before doing so; this version is somewhat more flexible in the
format of its input.
e16baf7a5fe7ac1453381d0017ed1dcdeefbc995 07-Aug-1994 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'SUNRPC'.
be22b15ae2ff8d7fe06b6e14fddf0c5b444a95da 27-May-1994 rgrimes <rgrimes@FreeBSD.org> BSD 4.4 Lite Lib Sources