summaryrefslogtreecommitdiff
path: root/lib/libc/net/getaddrinfo.c
Commit message (Collapse)AuthorAgeFilesLines
* add destination address selection described in RFC3484.Hajimu UMEMOTO2003-10-301-7/+412
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=121747
* oops, revert previous change to getaddrinfo.c. This is not relatedHajimu UMEMOTO2003-10-241-275/+155
| | | | | | | | to RFC3493. The previous change was related to RFC3484 (Default Address Selection for IPv6), and it will come later. Notes: svn path=/head/; revision=121474
* Switch Advanced Sockets API for IPv6 from RFC2292 to RFC3542Hajimu UMEMOTO2003-10-241-155/+275
| | | | | | | | | | | | | (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 Notes: svn path=/head/; revision=121472
* reorder functions to be in sync with KAME.Hajimu UMEMOTO2003-10-231-128/+132
| | | | Notes: svn path=/head/; revision=121426
* EAI_ADDRFAMILY and EAI_NODATA was deprecated in RFC3493Hajimu UMEMOTO2003-10-231-10/+4
| | | | | | | | | | | (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 Notes: svn path=/head/; revision=121425
* oops, gai_strerror must return default value when error codeHajimu UMEMOTO2003-10-221-0/+1
| | | | | | | isn't found in ai_errlist. Notes: svn path=/head/; revision=121348
* make ai_errlist struct. this is preparation for RFC3493Hajimu UMEMOTO2003-10-221-19/+32
| | | | | | | | | (EAI_NODATA is depricated). Obtained from: KAME Notes: svn path=/head/; revision=121347
* Replace use of a spinlock with a mutex.Daniel Eischen2003-05-041-6/+4
| | | | Notes: svn path=/head/; revision=114681
* Back out the `hiding' of strlcpy and strlcat. Several peopleJacques Vidrine2003-05-011-2/+2
| | | | | | | vocally objected to this safety belt. Notes: svn path=/head/; revision=114443
* `Hide' strlcpy and strlcat (using the namespace.h / __weak_referenceJacques Vidrine2003-04-291-2/+2
| | | | | | | | | | 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 Notes: svn path=/head/; revision=114256
* Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' byJacques Vidrine2003-04-241-1/+1
| | | | | | | | | namespace.h. Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113976
* Eliminate 19 warnings in libc (at level WARNS=2) of theJacques Vidrine2003-02-271-1/+1
| | | | | | | `implicit declaration of function' variety. Notes: svn path=/head/; revision=111618
* - scopeid is u_int32_tHajimu UMEMOTO2002-10-251-14/+21
| | | | | | | | | | - strtoul pedant. pointed out by deraadt Obtained from: KAME MFC after: 1 week Notes: svn path=/head/; revision=105943
* - kill strcpyHajimu UMEMOTO2002-10-251-67/+56
| | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=105940
* Put giant locks due to make getaddrinfo(), getnameinfo()Hajimu UMEMOTO2002-10-061-1/+22
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=104558
* Allocate 64K recieve buffer for DNS responses.Hajimu UMEMOTO2002-09-151-20/+45
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=103357
* Check for truncation in calls to res_send/res_query/res_search.Jacques Vidrine2002-09-151-1/+3
| | | | | | | Fail when it is detected. Notes: svn path=/head/; revision=103350
* Backout the increase of MAXPACKET from 1024 to 65536: itJacques Vidrine2002-09-151-1/+5
| | | | | | | | | broke pthreads. Reported by: mbr, tjr Notes: svn path=/head/; revision=103335
* When using res_send/res_query/res_search, the caller must eitherJacques Vidrine2002-09-131-5/+1
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=103307
* Fixed getaddrinfo to honor sortlist in /etc/resolv.confJim Pirzyk2002-08-211-0/+82
| | | | | | | | | | PR: bin/27939 Reviewed by: ru, sheldonh (about a year ago) Obtained from: ume (via KAME, I think) MFC after: 1 month Notes: svn path=/head/; revision=102237
* Remove an #include <syslog.h>. It's already included conditionallyMaxime Henrion2002-08-021-1/+0
| | | | | | | | | above, as it should be. Submitted by: Olivier Houchard <cognet@ci0.org> Notes: svn path=/head/; revision=101221
* Fix the style of the SCM ID's.David E. O'Brien2002-03-221-1/+3
| | | | | | | I believe have made all of libc .c's as consistent as possible. Notes: svn path=/head/; revision=92986
* Remove multi-line __P() usage.David E. O'Brien2002-03-221-16/+16
| | | | Notes: svn path=/head/; revision=92941
* Remove __P() usage.David E. O'Brien2002-03-211-18/+18
| | | | Notes: svn path=/head/; revision=92905
* balance parens.Alfred Perlstein2002-02-051-1/+1
| | | | | | | Submitted by: mbr Notes: svn path=/head/; revision=90273
* Fix cc -Wall, fix rcsid warnings, add missing prototypes,Alfred Perlstein2002-02-051-0/+4
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=90271
* Return ENONAME if getaddrinfo() is called with AI_NUMERICHOSTPeter Pentchev2002-02-011-1/+1
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=90053
* Implement EDNS0 support, as EDNS0 support will be made mandatory forHajimu UMEMOTO2001-06-101-1/+5
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=78012
* Nuke non-standard EAI_RESNULL.Hajimu UMEMOTO2001-03-171-8/+0
| | | | Notes: svn path=/head/; revision=74393
* Fix style that got corrupted.David E. O'Brien2001-03-051-17/+17
| | | | Notes: svn path=/head/; revision=73665
* Fix FreeBSD id style breakage from rev 1.17David E. O'Brien2001-03-051-1/+1
| | | | Notes: svn path=/head/; revision=73663
* Enable AI_ADDRCONFIG as a valid flag of getaddrinfo(3). SomeHajimu UMEMOTO2001-02-191-5/+0
| | | | | | | | | applications specify AI_ADDRCONFIG and fail to run under FreeBSD. Latest mews is known. Now, getaddrinfo(3) behaves according to AI_ADDRCONFIG. Notes: svn path=/head/; revision=72693
* Remove _THREAD_SAFE and make libc thread-safe by default byDaniel Eischen2001-01-241-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=71579
* Add nsswitch support. By creating an /etc/nsswitch.conf file, you canJacques Vidrine2000-09-061-234/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=65532
* Use _close() instead of close() in addrconfig() to keep it from becoming aJason Evans2000-07-211-3/+3
| | | | | | | potential cancellation point in libc_r. Notes: svn path=/head/; revision=63704
* reject empty scopeid. use strtoul() for checking all-numericness ofJun-ichiro itojun Hagino2000-07-091-8/+15
| | | | | | | | portname. explicitly reject empty numeric portname. sync with kame. based on comments from itohy@netbsd.org Notes: svn path=/head/; revision=62836
* sync with kame.Jun-ichiro itojun Hagino2000-07-051-29/+50
| | | | | | | | - better return code. from enami@netbsd - do not use "class" as variable name. C++ guy had trouble with it. Notes: svn path=/head/; revision=62614
* Don't call _getipnodebyname_multi(). It fixes the problem thatHajimu UMEMOTO2000-06-201-190/+1216
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=61877
* Change getaddrinfo() resolve orderYoshinobu Inoue2000-04-201-44/+23
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=59411
* Change IPv6 scoped addr format again based on recent standard discussion.Yoshinobu Inoue2000-02-191-2/+2
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=57340
* Let getaddrinfo() and related functions supports traditional IPv4 formatYoshinobu Inoue2000-02-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | (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 Notes: svn path=/head/; revision=57107
* IPv6 scoped addr format is changed as recent KAME change.Yoshinobu Inoue2000-02-091-2/+2
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=57069
* Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),Jason Evans2000-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=56698
* Fix getaddrinfo() behaviour to be more compliant with RFC2553. Patches areYoshinobu Inoue2000-01-261-116/+17
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=56627
* added IPv4 mapped IPv6 addr consideration for getaddrinfo() reverse lookup caseYoshinobu Inoue2000-01-131-1/+4
| | | | Notes: svn path=/head/; revision=55876
* Add three-tier symbol naming in support of POSIX thread cancellationJason Evans2000-01-121-2/+2
| | | | | | | | | 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(). Notes: svn path=/head/; revision=55837
* Small bug fix and improvementsYoshinobu Inoue1999-12-281-0/+7
| | | | | | | | | | | (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. Notes: svn path=/head/; revision=55167
* Getaddrinfo(), getnameinfo(), and etc support in libc/net.Yoshinobu Inoue1999-12-281-0/+1014
Several udp and raw apps IPv6 support. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project Notes: svn path=/head/; revision=55163