Commit Graph

40 Commits

Author SHA1 Message Date
kleink 91491e8dda Change the `len' arguemtn to gethostbyaddr(3) from int to socklen_t in
accordance with XNS5.2; fixes PR standards/12703.
2001-04-26 12:55:31 +00:00
christos 663f790f35 remove redundant declarations. 2000-12-20 20:51:08 +00:00
sommerfeld 4c38fc5aac Varargsify dprintf to allow for format string checking 2000-10-04 14:56:24 +00:00
itojun 698d9a8d8b on gethostby* with NIS backend, make a lookup against ipnodes.{byname,byaddr}
for non-IPv4 address.  obeys solaris8 practice.

XXX does not support scoped address extension, as gethostby* are not
scope-aware.  always use getaddrinfo/getnameinfo.
XXX it is not very useful at this moment, if you define multiple entries for
single hostname.  see PR 10713 for detail.
2000-07-30 03:01:01 +00:00
itojun 31089a149f plug host_addrs overrun. rogue NIS server can transmit tons of lines,
effectively overrun host_addrs buffer.
2000-07-30 02:44:36 +00:00
itohy 7daefc5a5a Passing "char" values to ctype(3) functions is problematic.
If an argument of a ctype function is outside "unsigned char"
and if it is not EOF, the behavior is undefined.

The isascii(3) is the sole exception of above and it was used to
be used to check a value was valid for other ctype functions in
ancient systems.  On modern systems, the ctype functions take
all values of "unsigned char", and this check is obsolete and
even wrong for non-ASCII systems.  However, we leave the isascii()
untouched for now, so as not to change the current behavior.
2000-07-07 08:03:36 +00:00
christos 5570317afb add CONSTCOND where appropriate 2000-07-06 02:52:07 +00:00
tron b4969ca513 Fix an alignment problem introduced by the patch for PR lib/8032.
Fixes PR lib/10048 by J.T. Conklin.
2000-05-23 07:03:10 +00:00
itojun e1e1e8e6ba sync with BIND 4.9.7. strict boundary checking. 2000-04-25 13:47:38 +00:00
christos e904ed8773 Try to silence some of the lint warnings. Unfortunately we cannot fix
them all right now until we fix the ALIGN() macro to return u_long in
all the ports.
2000-04-02 21:31:54 +00:00
mycroft c6a0f46b4f Delint. 2000-01-22 22:53:59 +00:00
mycroft 605490369c Delint.
Remove trailing ; from uses of __weak_alias().  The macro inserts this if
needed.
2000-01-22 22:19:07 +00:00
assar 8f5685ec6b ignore KEY and SIG records when matching responses to the query. we
get those as extras from DNSsec-enabled name servers.
1999-12-28 15:47:41 +00:00
lukem 0e4f2591aa change default nsswitch.conf entry for `hosts' from:
hosts: dns files
to
	hosts: files dns

this should speed things up a lot at boot if hostnames that are in
/etc/hosts are used for ifconfig, route, etc.
1999-10-24 12:36:02 +00:00
lukem d896261208 back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
1999-09-20 04:38:56 +00:00
lukem b48252f365 * 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
1999-09-16 11:44:54 +00:00
itojun daa44a5758 do not make reverse query against IPv6 unspecified, or loopback addresses.
From: ume@mahoroba.org
1999-08-09 15:00:14 +00:00
christos caf92b66b5 - make sure that host_addr is suitably aligned
- add appropriate casts
- take out & in from array; it is meaningless
1999-07-19 19:42:27 +00:00
tron 5f9dd87d66 Make sure that "h_addr_list" pointers are longword aligned because some
broken applications depend on it. Fixes PR lib/8032 by David K Brownlee.
1999-07-19 17:43:59 +00:00
itojun 2842a2f6bb fix name resolution problem when you have "hosts: files dns" on
/etc/nsswitch.conf.

This was because of two reasons:
- /etc/hosts lookup code damaged some of internal
  state used by gethostbyname2().
- getaddrinfo() was not persistent enough against errors.

Sorry for the delay, and hope this fix all the following PRs
(I checked in my environment immitating those PRs and it worked for me)
PR: 7901, 7912, 7921
1999-07-06 02:00:41 +00:00
itojun 06d4151d10 check address family on getting entries from /etc/hosts. 1999-07-04 22:44:28 +00:00
itojun e061ef3163 fix hardcoded T_A.
this fixes gethostbyname2(host, AF_INET6) to actually work.
1999-07-01 16:43:18 +00:00
tron 23b3336739 As discussed on "tech-net@netbsd.org":
Enhance the file resolver to return all IP addresses of a host on a
call to gethostbyname().
1999-06-02 22:14:07 +00:00
christos 5b997c7925 Remove unused 'len' and the relevant gcc kludges. 1999-05-04 13:51:39 +00:00
christos 588dd8cf5a Don't bother de-linting inside __GNUC__ ifdefs. 1999-05-03 15:20:28 +00:00
lukem 257ec2e899 specifically include stdarg/varargs.h 1999-04-18 02:27:53 +00:00
lukem 0da2aba208 minor knf; don't exceed 80 columns ;) 1999-01-20 23:31:02 +00:00
christos a45cc02ea7 add ARGSUSED 1999-01-20 13:09:04 +00:00
lukem 6b348d99e9 constify ns_dtab defs 1999-01-19 08:26:35 +00:00
lukem 66c9a837d5 convert to new nsdispatch(3). lookup defaults back to "dns files" 1999-01-19 08:01:12 +00:00
lukem 8b9d148c71 before each call to nsdispatch(), set h_errno to NETDB_INTERNAL, and only
change to NETDB_SUCCESS if nsdispatch() returns NS_SUCCESS.  it is up to the
internal methods to change h_errno from NETDB_INTERNAL to a more appropriate
value when an error is detected.
1999-01-18 05:26:08 +00:00
lukem 2bf40fa435 pull nsswitch up to main branch
convert getnetby*() to nsswitch (from resolv.conf lookup)
1999-01-16 07:48:23 +00:00
christos 2c89343c25 delint 1998-11-13 15:46:52 +00:00
kleink a292d8ec80 (bcmp(), bcopy(), bzero()) -> (memcmp(), memcpy(), memset()) 1998-10-15 10:22:23 +00:00
kleink 0b11c41974 Since these files are shared with parts of the BIND-4 userland (outside libc),
do the internal symbol renaming dance only if inside the libc build environment.
1998-10-14 19:33:49 +00:00
kleink b1683a098a Need internal names for gethostby{addr,name}(). 1998-10-13 20:54:02 +00:00
perry 198f98faf0 $Id: -> Id: (to make hunting down other bad Ids easier). 1998-01-06 05:01:16 +00:00
thorpej f6d3855780 Bring over changes where were mistakenly committed to gethostnamadr.c:
date: 1997/07/21 14:07:54;  author: jtc;  state: Exp;  lines: +3 -2
If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore.  The library will use those
names internally.  Weak aliases are used to provide the original names
to the API.

This is only the first part of this change.  It is most of the functions
which are implemented in C for all NetBSD ports.  Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
1997-07-31 20:55:21 +00:00
mrg 38bfb6cd0a merge bind 4.9.6 resolver. still need to fix <resolv.h> 1997-07-20 13:33:17 +00:00
mrg d507e9e46d bind 4.9.6 resolver files. 1997-07-20 04:07:42 +00:00