Home | History | Annotate | Download | only in net
History log of /src/lib/libc/net/getnetnamadr.c
RevisionDateAuthorComments
 1.45  05-Jun-2020  nia Remove more bogus tests for 64-bit i386 and SuperH.

These are always false.
 1.44  26-Oct-2015  christos put the state back after it is used.
 1.43  26-Oct-2015  christos PR/50367: Stefan Schaeckeler: Apply fix to obey RES_CHECKNAME to getnetbyaddr
and getnetbyname.
 1.42  13-Mar-2012  christos branches: 1.42.10; 1.42.12;
PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.41  18-May-2008  lukem branches: 1.41.2; 1.41.6; 1.41.22;
Fix possible memory leak in error path.
Part of PR 38677.
 1.40  08-May-2008  lukem Convert getnetbyname(3) and getnetbyaddr(3) to the more "standard"
nsdispatch() backend method API.
 1.39  08-May-2008  lukem Fix a misuse of an automatic as a static that was exposed by the previous.
 1.38  08-May-2008  lukem Fix DNS getnetbyname(), which has been broken for at least 5.5 years
(if not longer).
 1.37  27-Jan-2007  christos branches: 1.37.10; 1.37.12;
Appropriate versions are not supplied by bind anymore.
 1.36  27-Jan-2007  christos merge in resolver portion of bind-9.4.0-rc2
 1.35  15-Oct-2006  christos branches: 1.35.2; 1.35.4;
fix incomplete initializers
 1.34  18-Sep-2006  tsutsui Change type of `net' variable passed via va_list in
_{files,dns,yp}_getenetbyaddr() functions from unsigned long to uint32_t.
In rev 1.29, getnetbyaddr(3) was changed to take uint32_t `net' argument
and also passisng uint32_t `net' to nsdispatch(3) varargs, but
these callback functions were not changed accordingly.

Patch was provided by christos, and this fixes amd(8) coredumps on alpha
when /etc/nsswitch.conf has more than one sources for netgroups.
 1.33  17-Mar-2006  ginsbach branches: 1.33.2;
Fix Coverity issue 2281, resource leak, function return without freeing
dynamically allocated storage.
 1.32  01-Jun-2005  lukem Move the test for "more strict reverse lookup handling" to the correct
location so that an uninitialized `in' won't be used if net_i == BYADDR.
Detected with gcc -Wuninitialized, confirmed by diffing against BIND 4.9.11.
(The bug was introduced in rev 1.26. Hi Itojun! :)
 1.31  23-May-2004  christos branches: 1.31.2;
centralize res_*init() calls in __res_get_state()
 1.30  21-May-2004  christos Finish bind9 resolver merge.
 1.29  08-May-2004  kleink struct netnet.n_net used to be an unsigned long integer.

In XNS5, and subsequently in POSIX-2001 it was changed to socklen_t.

To accomodate for this while preserving binary compatibility with the
old interface, prepend or append 32 bits of padding, depending on
the (LP64 data model) architecture's endianness. Fixes PR
standards/21411 from Ben Harris.

This should be deleted the next time the libc major number is
incremented.

Also, update getnetbyaddr(3)'s `net' argument accordingly.
 1.28  29-Jan-2004  lukem branches: 1.28.4;
Use the correct parameters when building the YP map name in _yp_getnetbyaddr().
Fixes getnetbyaddr() when reading from YP. From Brian Ginsbach in email.
 1.27  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.26  14-Nov-2002  itojun pull in changes in http://www.isc.org/products/BIND/patches/bind4910.diff
- better error check on __dn_skipname
- more strict reverse lookup handling
 1.25  13-Nov-2002  itojun fix remote buffer overrun. from openbsd tree (1997).
 1.24  27-Aug-2002  itojun allocate 64K recieve buffer for DNS responses.
 1.23  16-Aug-2002  itojun eliminate sprintf, use snprintf. check strlcat error.
 1.22  26-Jun-2002  itojun avoid remote buffer overrun on hostbuf[]. From: Joost Pol <joost@pine.nl>

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.

this fix is critical.
 1.21  26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.20  20-Dec-2000  christos branches: 1.20.2; 1.20.4;
remove redundant declarations.
 1.19  22-Jan-2000  mycroft branches: 1.19.4;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.18  20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.17  16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.16  04-May-1999  kleink Use a _files prefix for local backend routines; would clash with namespace.h
otherwise.
 1.15  03-May-1999  christos sprinkle argsused till lint smiles at you.
 1.14  18-Apr-1999  lukem specifically include stdarg/varargs.h
 1.13  20-Jan-1999  christos branches: 1.13.2;
add ARGSUSED
 1.12  19-Jan-1999  lukem constify ns_dtab defs
 1.11  19-Jan-1999  lukem convert to new nsdispatch(3)
 1.10  19-Jan-1999  lukem support nis lookups for getnetby*()
 1.9  16-Jan-1999  lukem remove unused vars. remove register
 1.8  16-Jan-1999  lukem pull nsswitch up to main branch
convert getnetby*() to nsswitch (from resolv.conf lookup)
 1.7  05-Dec-1998  pk Check the results of argument decomposition in octets to prevent
garbage being sent to name servers.
 1.6  13-Nov-1998  christos delint
 1.5  06-Jan-1998  perry $Id: -> Id: (to make hunting down other bad Ids easier).
 1.4  19-Aug-1997  mikel sync __getnetbyaddr() prototypes with the one in getnetbyaddr.c; from
Krister Walfridsson in PR lib/4009
 1.3  31-Jul-1997  thorpej - Add __weak_alias() namespace protection and update for changes to
getnetnyname.c and getnetbyaddr.c.
- Now that getnetbyname() and getnetbyaddr() support looking up their
entries via BIND (they were previously file-only), add "lookup ..."
dispatch support (in /etc/resolv.conf), a'la gethostby*().
 1.2  20-Jul-1997  mrg merge bind 4.9.6 resolver. still need to fix <resolv.h>
 1.1  20-Jul-1997  mrg branches: 1.1.1;
Initial revision
 1.1.1.1  20-Jul-1997  mrg bind 4.9.6 resolver files.
 1.13.2.1  26-Jun-2002  he Pull up revision 1.22 (requested by he):
Fix remote buffer overrun on hostbuf[]. Also fix up logic of
buffer handling.
 1.19.4.4  14-Nov-2002  itojun lib/libc/net/getnetnamadr.c 1.25-1.26

Fix remote buffer overrun.

(itojun)
 1.19.4.3  13-Nov-2002  itojun lib/libc/net/getnetnamadr.c 1.25

Fix remote buffer overrun.

(itojun)
 1.19.4.2  04-Sep-2002  itojun lib/libc/net/getaddrinfo.c 1.56
lib/libc/net/res_mkquery.c 1.22
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.

lib/libc/net/getaddrinfo.c 1.50
remove redundant declarations of h_errno and __hostalias

lib/libc/net/getaddrinfo.c 1.52
make sure "qname" argument to getanswer() is properly given. from lukem

lib/libc/net/getaddrinfo.c 1.54
lib/libc/net/gethnamaddr.c 1.43,1.49-1.50
lib/libc/net/getnetnamadr.c 1.23
use snprintf, string manipulation cleanups

lib/libc/net/getaddrinfo.c 1.57-1.59
correct port range check and signed/unsigned mixup

lib/libc/net/getaddrinfo.c 1.60-1.61
lint clean

lib/libc/net/getaddrinfo.c 1.62
lib/libc/net/gethnamaddr.c 1.51
drop AAAA reply with IPv4 mapped address. sync w/kame
draft-itojun-v6ops-v4mapped-harmful-00.txt

lib/libc/net/getaddrinfo.c 1.63
lib/libc/net/gethnamaddr.c 1.52
lib/libc/net/getnetnamadr.c 1.24
allocate 64K recieve buffer for DNS responses.

lib/libc/net/gethnamaddr.c 1.38
Varargsify dprintf to allow for format string checking

lib/libc/net/gethnamaddr.c 1.39
lib/libc/net/getnetnamadr.c 1.20
remove redundant declarations.

lib/libc/net/gethnamaddr.c 1.41
do not reverse-lookup scoped IPv6 address. it does not make sense as
there's no way to give scope identifier. sync w/kame

lib/libc/net/gethnamaddr.c 1.42
style

lib/libc/net/gethnamaddr.c 1.45
do not pass uninitialized variable to nsdispatch().

lib/libc/net/gethnamaddr.c 1.48
query ip6.arpa then ip6.int for IPv6 reverse lookup. follows RFC3152.
 1.19.4.1  26-Jun-2002  he Pull up revision 1.22 (requested by itojun):
Fix remote buffer overrun on hostbuf[]. Also fix up logic of
buffer handling.
 1.20.4.6  15-Mar-2004  jmc Pullup rev 1.28 (requested by lukem in ticket #1602)

Use the correct parameters when building the YP map name in _yp_getnetbyaddr().
Fixes getnetbyaddr() when reading from YP.
 1.20.4.5  15-Nov-2002  lukem Pull up revision 1.26 (requested by itojun in ticket #990):
pull in changes in http://www.isc.org/products/BIND/patches/bind4910.diff
- better error check on __dn_skipname
- more strict reverse lookup handling
 1.20.4.4  15-Nov-2002  lukem Pull up revision 1.25 (requested by itojun in ticket #986):
fix remote buffer overrun. from openbsd tree (1997).
 1.20.4.3  27-Aug-2002  lukem Pull up revision 1.24 (requested by itojun in ticket #735):
allocate 64K recieve buffer for DNS responses.
 1.20.4.2  17-Aug-2002  lukem Pull up revision 1.23 (requested by itojun in ticket #694):
eliminate sprintf, use snprintf. check strlcat error.
 1.20.4.1  26-Jun-2002  lukem Pull up revision 1.22 (requested by itojun in ticket #371):
avoid remote buffer overrun on hostbuf[]. From: Joost Pol <joost@pine.nl>
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.
this fix is critical.
 1.20.2.4  10-Dec-2002  thorpej Sync with HEAD.
 1.20.2.3  27-Aug-2002  nathanw Catch up to -current.
 1.20.2.2  01-Aug-2002  nathanw Catch up to -current.
 1.20.2.1  21-Jun-2002  nathanw Catch up to -current.
 1.28.4.1  05-Jul-2005  riz Pull up revision 1.29 (requested by kleink in ticket #2015):
struct netent.n_net used to be an unsigned long integer.
In XNS5, and subsequently in POSIX-2001 it was changed to socklen_t.
To accomodate for this while preserving binary compatibility with the
old interface, prepend or append 32 bits of padding, depending on
the (LP64 data model) architecture's endianness. Fixes PR
standards/21411 from Ben Harris.
This should be deleted the next time the libc major number is
incremented.
Also, update getnetbyaddr(3)'s `net' argument accordingly.
 1.31.2.2  06-Oct-2006  ghen Pull up following revision(s) (requested by tsutsui in ticket #1522):
lib/libc/net/getnetnamadr.c: revision 1.34
Change type of `net' variable passed via va_list in
_{files,dns,yp}_getenetbyaddr() functions from unsigned long to uint32_t.
In rev 1.29, getnetbyaddr(3) was changed to take uint32_t `net' argument
and also passisng uint32_t `net' to nsdispatch(3) varargs, but
these callback functions were not changed accordingly.
Patch was provided by christos, and this fixes amd(8) coredumps on alpha
when /etc/nsswitch.conf has more than one sources for netgroups.
 1.31.2.1  11-Jun-2005  tron Pull up revision 1.32 (requested by lukem in ticket #392):
Move the test for "more strict reverse lookup handling" to the correct
location so that an uninitialized `in' won't be used if net_i == BYADDR.
Detected with gcc -Wuninitialized, confirmed by diffing against BIND 4.9.11.
(The bug was introduced in rev 1.26. Hi Itojun! :)
 1.33.2.1  23-Sep-2006  snj Pull up following revision(s) (requested by tsutsui in ticket #179):
lib/libc/net/getnetnamadr.c: revision 1.34
Change type of `net' variable passed via va_list in
_{files,dns,yp}_getenetbyaddr() functions from unsigned long to uint32_t.
In rev 1.29, getnetbyaddr(3) was changed to take uint32_t `net' argument
and also passisng uint32_t `net' to nsdispatch(3) varargs, but
these callback functions were not changed accordingly.
Patch was provided by christos, and this fixes amd(8) coredumps on alpha
when /etc/nsswitch.conf has more than one sources for netgroups.
 1.35.4.1  03-Jun-2007  wrstuden Catch up with now-somewhat-dated netbsd-4. These changes took longer
than expected for me to actually get around to merging.
 1.35.2.1  17-May-2007  jdc Add missing BIND 9.4.x include file and library changes (requested by
tron in ticket #662).
 1.37.12.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.37.10.2  04-Jun-2008  yamt sync with head
 1.37.10.1  18-May-2008  yamt sync with head.
 1.41.22.1  17-Nov-2015  bouyer Pull up following revision(s) (requested by christos in ticket #1340):
lib/libc/net/getnetnamadr.c: revision 1.43 via patch
lib/libc/net/getnetnamadr.c: revision 1.44 via patch
put the state back after it is used.
PR/50367: Stefan Schaeckeler: Apply fix to obey RES_CHECKNAME to getnetbyaddr
and getnetbyname.
 1.41.6.2  18-May-2008  lukem Fix possible memory leak in error path.
Part of PR 38677.
 1.41.6.1  18-May-2008  lukem file getnetnamadr.c was added on branch christos-time_t on 2008-05-18 22:36:16 +0000
 1.41.2.1  17-Apr-2012  yamt sync with head
 1.42.12.1  08-Nov-2015  riz Pull up following revision(s) (requested by christos in ticket #1012):
lib/libc/net/getnetnamadr.c: revision 1.43
lib/libc/net/getnetnamadr.c: revision 1.44
external/gpl3/binutils/dist/binutils/arsup.c: revision 1.2
put the state back after it is used.
PR/50367: Stefan Schaeckeler: Apply fix to obey RES_CHECKNAME to getnetbyaddr
and getnetbyname.
use asprintf(3)
 1.42.10.1  08-Nov-2015  riz Pull up following revision(s) (requested by christos in ticket #1012):
lib/libc/net/getnetnamadr.c: revision 1.43
lib/libc/net/getnetnamadr.c: revision 1.44
external/gpl3/binutils/dist/binutils/arsup.c: revision 1.2
put the state back after it is used.
PR/50367: Stefan Schaeckeler: Apply fix to obey RES_CHECKNAME to getnetbyaddr
and getnetbyname.
use asprintf(3)

RSS XML Feed