Commit Graph

95 Commits

Author SHA1 Message Date
wiz 3dee657aa5 Revert a -> an changes: Adding an 'n' follows pronunciation, not writing. 2009-10-02 07:41:08 +00:00
cegger 45db136e91 fix grammar: a -> an 2009-10-02 06:49:23 +00:00
tsarna 1f4f234ea9 Introduce allocaddrinfo(3) to make writing getaddrinfo() nss plugins easier.
Discussed on tech-net.
2009-10-02 02:45:28 +00:00
tls 8d33a6da32 Cause getaddrinfo() without socktype specification to work correctly for
numeric addresses.  The documentation appears to say this works, and some
other systems support it -- more importantly, why should it _not_ work?  If
it does not, getaddrinfo() cannot be used as a general-purpose textual to
binary address conversion utility function; yet it is the only such function
we have in the system, since inet_pton() requires a priori knowledge of the
address family.

This change also causes getaddrinfo() with NULL hint (expressly documented
as working) to work properly for numeric addresses.
2009-01-23 00:48:57 +00:00
lukem e39aac16df Add a missing const. 2008-04-19 07:56:34 +00:00
christos 7b1793900f make this compile without INET6 (Scott Ellis) 2007-06-29 15:53:21 +00:00
christos 2f53e821af Since we are going to be looking for ports many times, use a centralized
servent data structure and pass the stayopen hint.
2007-06-23 17:32:08 +00:00
christos f8178c49fa use syslog_r, from OpenBSD 2007-05-10 18:44:24 +00:00
christos ce2c90c7c1 fix incomplete initializers 2006-10-15 16:14:46 +00:00
christos 48314d6d96 memset the whole struct addrinfo, instead of trying to figure out if we
have a pad member or not.
2006-10-14 21:45:29 +00:00
christos ae46aa1c5a Call endservent_r. From Hajimu UMEMOTO 2006-07-19 13:16:12 +00:00
christos 2bc28e91d7 use getservbyname_r. 2006-07-18 15:55:55 +00:00
christos 6b7bf056a3 Remove comments that do not reflect reality anymore. 2006-07-18 14:00:40 +00:00
rpaulo 2c7819a4c8 Make macros more readable. No functional change. 2006-03-25 12:09:40 +00:00
christos 40c58e8b04 Coverity CID 2363: cur is known not to be NULL. 2006-03-21 23:56:47 +00:00
christos 432fdd32e0 Coverity CID 2364: cur is known not to be NULL. 2006-03-21 23:55:56 +00:00
christos f12fd11960 Coverity CID 2430: cur is known not to be NULL. 2006-03-21 23:55:02 +00:00
mjl f0174eb74b Correct obvious typo 2006-03-21 12:08:19 +00:00
ginsbach e0882f7342 Add EAI_OVERFLOW as specified in RFC3493, POSIX and XPG6. 2006-02-17 15:55:01 +00:00
ginsbach ac8d9f1ddd Fix spelling mistake in comment. From OpenBSD. 2006-02-13 17:16:20 +00:00
yamt 765035980c constify and remove an unnecessary __UNCONST. 2005-12-02 11:22:09 +00:00
christos 03256c6e55 WARNS=4 2005-11-29 03:11:58 +00:00
tsarna 064cb14faa Rest of fix for PR#31184: getaddrinfo() now honors resolv.conf sortlist
directive for dns answers.

Also, unifdef the RESLVSORT (non-)option sillyness.

Reviewed by christos.
2005-09-15 23:33:41 +00:00
christos 71fe243008 make yp stuff re-entrant. 2004-05-27 18:40:07 +00:00
christos 13cc3543b5 centralize res_*init() calls in __res_get_state() 2004-05-23 16:54:12 +00:00
christos d14c1915e0 Finish bind9 resolver merge. 2004-05-21 02:30:03 +00:00
itojun 66909f0052 remove prototype decl for removed function 2004-04-14 04:46:04 +00:00
itojun 777d124a65 remove unused code 2004-04-14 04:45:28 +00:00
itojun a1b7e86ab4 implement AI_NUMERICSERV (as defined in RFC3493) 2004-04-14 04:37:06 +00:00
itojun 6a95da7f05 bound copies 2003-05-17 01:36:03 +00:00
itojun ece2a37389 fill ai_canonname field for numeric hostname, by the given hostname.
folows new recommendation in RFC3493
2003-05-08 05:30:53 +00:00
itojun b5dda3e238 From: "Jason L. Wright" <jason@thought.net>
The man page for getaddrinfo() and RFC2553 says it should return EAI_NONAME
for the case where hostname != NULL, hostname is not a numeric string and
ai_flags has the AI_NUMERICHOST bit set.  Instead, it returns EAI_NODATA
for this case.  The diff below makes it return EAI_NONAME for this case.

This is why ntpq and ntpdc from ntp-4.1.74 can't resolve hostnames,
but work fine with numeric strings like ::1 or 127.0.0.1.
2003-03-17 23:10:25 +00:00
itojun 62f36ff8e2 allocate 64K recieve buffer for DNS responses. 2002-08-27 08:50:49 +00:00
itojun 949583590f drop AAAA reply with IPv4 mapped address. sync w/kame
draft-itojun-v6ops-v4mapped-harmful-00.txt
2002-08-22 16:32:14 +00:00
itojun a4cf77c9bb pacify lint. from he@netbsd 2002-07-01 22:05:08 +00:00
itojun 754f8759a4 lint clean. from martin husemann 2002-07-01 21:05:56 +00:00
itojun 9922c987a9 make more pedantic check on strtoul. from deraadt, sync w/kame 2002-07-01 07:42:49 +00:00
itojun 28735a6a17 correct port range check. from deraadt, sync w/kame, diff sent to bind-bugs 2002-06-29 12:23:10 +00:00
itojun 0c63dd3cf2 correct %d/%u mixup. 2002-06-27 10:22:07 +00:00
itojun 9cdbc86d39 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 NOT critical.
2002-06-26 06:00:26 +00:00
kleink 06d36d9eee struct addrinfo.ai_addrlen used to be a size_t, per RFC 2553.
In XNS5.2, and subsequently in POSIX-2001 and draft-ietf-ipngwg-rfc2553bis-02
it was changed to a 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.

This should be deleted the next time the libc major number is
incremented.
2002-05-14 13:45:13 +00:00
itojun 6cc1136ae1 use snprintf, not sprintf. sync with kame. 2001-08-20 02:33:31 +00:00
jdolecek ca797c3c15 make local constant arrays const 2001-01-25 22:50:55 +00:00
itojun 2dda99193c make sure "qname" argument to getanswer() is properly given. from lukem 2001-01-24 15:05:48 +00:00
lukem a976c8e346 sprinkle _DIAGASSERT() around 2001-01-04 03:56:17 +00:00
christos 39b08b8fe0 remove redundant declarations of h_errno and __hostalias 2000-12-10 04:19:53 +00:00
lukem 4a1b4395d7 don't bother declaring in6_addrany[] and in6_loopback #ifndef INET6 2000-09-23 04:40:19 +00:00
itojun e871d0cd31 on /etc/hosts lookup, set "official host name" (the leftmost hostname)
into ai_canonname.  this is to synchronize with practice in gethostby*.
comment from ume@mahoroba.org.  sync with kame.
2000-08-31 17:32:39 +00:00
itojun babc498cc8 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.
2000-08-09 14:40:52 +00:00
itojun 20aa4f5b37 reject empty scopeid/numeric portname explicitly. sync with kame. 2000-07-09 04:48:17 +00:00