summaryrefslogtreecommitdiff
path: root/lib/libc/net
Commit message (Collapse)AuthorAgeFilesLines
* Markup nits.Ruslan Ermilov2004-07-071-2/+4
| | | | Notes: svn path=/head/; revision=131758
* Markup fixes.Ruslan Ermilov2004-07-053-128/+180
| | | | Notes: svn path=/head/; revision=131611
* Eliminate double whitespace.Ruslan Ermilov2004-07-031-1/+1
| | | | Notes: svn path=/head/; revision=131539
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-0212-35/+66
| | | | Notes: svn path=/head/; revision=131504
* Markup, grammar, and spelling fixes.Ruslan Ermilov2004-06-303-3/+7
| | | | Notes: svn path=/head/; revision=131365
* Spelling fixes.Mike Pritchard2004-06-212-3/+3
| | | | Notes: svn path=/head/; revision=130873
* Rename variable name from `name' to `hostname'.Hajimu UMEMOTO2004-06-161-7/+7
| | | | | | | | | | | | | This is a corresponding change to bin/67994. I'll soon commit bin/67994 into 4-STABLE. Actually, 5-CURRENT's getaddrinfo() doesn't have the problem mentiond in bin/67994. However, it is good to be in sync variable name with 4-STABLE and KAME. PR: bin/67994 Submitted by: JINMEI Tatuya <jinmei@ocean.jinmei.org> Notes: svn path=/head/; revision=130600
* Date bump.Bruce M Simpson2004-06-141-1/+1
| | | | | | | Requested by: krion Notes: svn path=/head/; revision=130469
* Document some return values.Bruce M Simpson2004-06-141-1/+20
| | | | | | | | PR: bin/22198 Submitted by: Nick Johnson (with cleanups) Notes: svn path=/head/; revision=130468
* use source address as a hint to determine destination addressHajimu UMEMOTO2004-06-021-50/+361
| | | | | | | by getipnodebyname(). Notes: svn path=/head/; revision=129984
* Add Aerospace Corporation copyrights to EUI64 support files.Brooks Davis2004-06-012-0/+52
| | | | | | | Suggested by: marcel, imp Notes: svn path=/head/; revision=129957
* Treat IPv4 private address as global scope rather than site scope.Hajimu UMEMOTO2004-05-311-1/+1
| | | | | | | | Though it breaks RFC 3484, without this change, dest addr selection doesn't work well under NAT environment. Notes: svn path=/head/; revision=129905
* use source address as a hint to determine destination address.Hajimu UMEMOTO2004-05-311-0/+111
| | | | | | | Obtained from: KAME Notes: svn path=/head/; revision=129901
* Add support for an /etc/eui64 file modeled on /etc/ethers. The API isBrooks Davis2004-05-263-2/+492
| | | | | | | | | modeled on ethers(3) except that all functions are thread-safe. Reviewed by: simokawa Notes: svn path=/head/; revision=129759
* Unbreak world.Ruslan Ermilov2004-04-211-3/+2
| | | | Notes: svn path=/head/; revision=128517
* MFdragonfly: resolver fix for timeouts on unqualified hostnamesNate Lawson2004-04-211-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | res_search only incremented got_servfail for h_errno == TRY_AGAIN *AND* hp->rcode == SERVFAIL. However, there are cases such as timeouts where rcode is not always set to SERVFAIL. This leads to inconsistent nameserver operation during multi-domain and truncated dot searches, especially during booting when portions of the network are being brought up simultanious with dns lookups. This patch attempts to correct the problem by unconditionally terminating the search if TRY_AGAIN is returned (after res_query has gone through all retries and name servers) instead of trying other domain elements in the domain seach path. This patch should fix reported problems (which I can reproduce) with some NFS mounts failing during boot. This occured because mount_nfs thought the host name lookup returned a definitive failure using a non-dotted host name when, in fact, it timed out on the first part (host.search.domain.name) and got a definitive host-not-found response on the second part (host.). Generally speaking, search path name server timeouts can exceed 60 seconds per element and most machines which consistently timeout on earlier portions of a search path are effectively non-operational due to the imposed delays. It is more important for DNS lookups to return the proper error code then to be able to recover a valid lookup in later portions of the search path in these situations. Obtained from: DragonFly MFC after: 3 weeks Notes: svn path=/head/; revision=128507
* Add a missing "*errp = h_errno" forgotten in rev 1.36.Pierre Beyssac2004-04-061-1/+2
| | | | Notes: svn path=/head/; revision=127933
* Fix _dns_ghbyname() to return NS_TRYAGAIN instead of NS_NOTFOUNDPierre Beyssac2004-04-051-4/+12
| | | | | | | | | | | | on temporary nameserver failure. This is necessary to get getipnodebyname(3) to correctly return h_errno=TRY_AGAIN instead of HOST_NOT_FOUND. Reviewed by: green, thomas MFC after: 1 week Notes: svn path=/head/; revision=127909
* The previous commit changed the behavior of nsdispatch() in theJacques Vidrine2004-04-011-3/+1
| | | | | | | | | | | | | | | | | case where an /etc/nsswitch.conf file was present, but could not be opened (e.g. due to permissions). Previously, the open failure condition was suppressed, and the built-in defaults were used. In revision 1.11, however, propagated the open failure causing all nsdispatch() invocations to return NS_UNAVAIL, and thus many APIs including getpwnam and gethostbyname unconditionally failed. This commit restores the previous behavior. Pointy hat: nectar (+1 for obstinance; ache had to use clue bat) Reported by: ache Notes: svn path=/head/; revision=127727
* When a dynamic NSS module is built and linked against a threadJacques Vidrine2004-03-302-22/+42
| | | | | | | | | | | | | | | | library, it may pull in that thread library at run time. If the process started out single-threaded, this could cause attempts to release locks that do not exist. Guard against this possibility by checking __isthreaded before invoking thread primitives. A similar problem remains if the process is linked against one thread library, but the NSS module is linked against another. This can only be avoided by careful design of the NSS module. Submitted by: Sean McNeil <sean@mcneil.com> (mostly; bugs are mine) Notes: svn path=/head/; revision=127625
* Don't try to pass off a struct sockaddr as a struct sockaddr_in when itDag-Erling Smørgrav2004-03-151-2/+2
| | | | | | | | | | may in fact very well be a struct sockaddr_in6. Just use plain struct sockaddr. This brings us yet another step closer to a clean -O2 build. Notes: svn path=/head/; revision=127028
* Make this compile with -O2. A proper fix would use a struct to representDag-Erling Smørgrav2004-03-151-22/+22
| | | | | | | | vectors, instead of requiring the caller to keep track of element size and count and pass them in by reference. Notes: svn path=/head/; revision=127012
* Whitespace nits.Dag-Erling Smørgrav2004-03-151-4/+4
| | | | Notes: svn path=/head/; revision=127011
* Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)Mark Murray2004-03-051-2/+2
| | | | | | | | | | | | | | | | | | that this provokes. "Wherever possible" means "In the kernel OR NOT C++" (implying C). There are places where (void *) pointers are not valid, such as for function pointers, but in the special case of (void *)0, agreement settles on it being OK. Most of the fixes were NULL where an integer zero was needed; many of the fixes were NULL where ascii <nul> ('\0') was needed, and a few were just "other". Tested on: i386 sparc64 Notes: svn path=/head/; revision=126643
* Make the resolver(3) and many associated interfaces much more reentrant.Brian Feldman2004-02-2512-52/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The getaddrinfo(3), getipnodebyname(3) and resolver(3) can coincide now with what should be totally reentrant, and h_errno values will now be preserved correctly, but this does not affect interfaces such as gethostbyname(3) which are still mostly non-reentrant. In all of these relevant functions, the thread-safety has been pushed down as far as it seems possible right now. This means that operations that are selected via nsdispatch(3) (i.e. files, yp, dns) are protected still under global locks that getaddrinfo(3) defines, but where possible the locking is greatly reduced. The most noticeable improvement is that multiple DNS lookups can now be run at the same time, and this shows major improvement in performance of DNS-lookup threaded programs, and solves the "Mozilla tab serialization" problem. No single-threaded applications need to be recompiled. Multi-threaded applications that reference "_res" to change resolver(3) options will need to be recompiled, and ones which reference "h_errno" will also if they desire the correct h_errno values. If the applications already understood that _res and h_errno were not thread-safe and had their own locking, they will see no performance improvement but will not actually break in any way. Please note that when NSS modules are used, or when nsdispatch(3) defaults to adding any lookups of its own to the individual libc _nsdispatch() calls, those MUST be reentrant as well. Notes: svn path=/head/; revision=126243
* add destination address selection support for getipnodebyname(3).Hajimu UMEMOTO2004-02-201-1/+225
| | | | | | | | though getipnodebyname(3) is obsoleted api, some major applications such as Mozilla are still using it. so, it will help ipv4 users. Notes: svn path=/head/; revision=126052
* style cleanup: Remove duplicate $FreeBSD$ tags.Colin Percival2004-02-101-1/+0
| | | | | | | | | | | These files had tags at the start of the file (incorrect, removed), and after the copyright notices (correct). Approved by: rwatson (mentor) Notes: svn path=/head/; revision=125667
* Unbreak world.Ruslan Ermilov2004-02-071-2/+2
| | | | Notes: svn path=/head/; revision=125562
* getnetbyname fixes:Diomidis Spinellis2004-02-071-22/+67
| | | | | | | | | | Do not choke on malformed network addresses. Return n_name in static space, not on the function's stack. MFC after: 1 week Notes: svn path=/head/; revision=125555
* It was reported that when using nss_ldap, getgrent(3) would behaveJacques Vidrine2004-01-091-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incorrectly when encountering `large' groups (many members and/or many long member names). The reporter tracked this down to the glibc NSS module compatibility code (nss_compat.c): it would prematurely record that a NSS module was finished iterating through its database in some cases. Two aspects are corrected: 1. nss_compat.c recorded that a NSS module was finished iterating whenever the module reported something other than SUCCESS. The correct logic is to continue iteration when the module reports either SUCCESS or RETURN. The __nss_compat_getgrent_r and __nss_compat_getpwent_r routines are updated to reflect this. 2. An internal helper macro __nss_compat_result is used to map glibc NSS status codes to BSD NSS status codes (e.g. NSS_STATUS_SUCCESS -> NS_SUCCESS). It provided the obvious mapping. When a NSS routine is called with a too-small buffer, the convention in the BSD NSS code is to report RETURN. (This is used to implement reentrant APIs such as getpwnam_r(3).) However, the convention in glibc for this case is to set errno = ERANGE and overload TRYAGAIN. __nss_compat_result is updated to handle this case. PR: bin/60287 Reported by: Lachlan O'Dea <odela01@ca.com> Notes: svn path=/head/; revision=124289
* Work around a `warning: zero-length printf format string'.Jacques Vidrine2004-01-061-1/+1
| | | | Notes: svn path=/head/; revision=124177
* Add support for timeout: and attempts: resolver options.Murray Stokely2003-12-071-0/+20
| | | | | | | | Submitted by: Paul Vixie <paul@vix.com> / ISC MFC After: 1 week Notes: svn path=/head/; revision=123236
* Add the userland part of the NET_RT_IFMALIST sysctl MIB. A new function,Bruce M Simpson2003-11-143-2/+322
| | | | | | | | | getifmaddrs(), is added to retrieve current multicast group memberships. Reviewed by: harti Notes: svn path=/head/; revision=122687
* u_int8_t cannot carry a number greater than 255.Hajimu UMEMOTO2003-11-141-3/+1
| | | | | | | Reported by: nectar Notes: svn path=/head/; revision=122682
* 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
* according to RFC3542 10.5, the 5th argment of inet6_opt_next()Hajimu UMEMOTO2003-10-251-1/+1
| | | | | | | | | is not size_t but socklen_t. Reported by: tinderbox Notes: svn path=/head/; revision=121496
* 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-246-366/+1400
| | | | | | | | | | | | | (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-232-17/+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
* stop use of NI_WITHSCOPEID. it was deprecated.Hajimu UMEMOTO2003-10-211-8/+3
| | | | | | | Obtained from: KAME Notes: svn path=/head/; revision=121316
* From OpenBSD:Bill Fenner2003-09-151-1/+1
| | | | | | | | | | | | | | | always widen the imputed netmask if it is narrower than the specified octets. fixes a strange behaviour where inet_net_pton would always return 4 (bits) for multicast addresses no matter how many octets were specified. negotiated with Paul Vixie, original author of this function. PR: standards/53151 Submitted by: Max Laier <max@love2party.net> Optained from: OpenBSD Notes: svn path=/head/; revision=120107
* Our getaddrinfo() and getnameinfo() are thread-safe butHajimu UMEMOTO2003-09-152-2/+10
| | | | | | | | | some limitation. Reported by: Marc G. Fournier <scrappy@hub.org> Notes: svn path=/head/; revision=120084
* mdoc(7): Properly mark C headers.Ruslan Ermilov2003-09-103-3/+3
| | | | Notes: svn path=/head/; revision=119964
* mdoc(7): Use the new feature of the .In macro.Ruslan Ermilov2003-09-087-18/+18
| | | | Notes: svn path=/head/; revision=119893
* An u_int8_t can never be bigger than 255, so remove a useless check.Maxime Henrion2003-07-251-2/+0
| | | | | | | Spotted by: GCC Notes: svn path=/head/; revision=118011
* Remove bogus non-reentrant "temporary" implementation of gethostbyaddr_r()Kris Kennaway2003-06-191-19/+0
| | | | | | | | | | that has been here for 6 years and 9 months. Reviewed by: deischen MFC After: 1 week Notes: svn path=/head/; revision=116574
* .Xr -> .Lb for librairy. There is no manual page corresponding to .Xr.Philippe Charnier2003-06-081-1/+1
| | | | Notes: svn path=/head/; revision=116022