Commit Graph

556 Commits

Author SHA1 Message Date
Andreas Schwab 1cef1b1908 Fix stack overflow in getaddrinfo with many results 2013-04-03 17:39:15 +02:00
Roland McGrath 356b348023 Never call syslog in __libc_message. 2013-03-28 10:38:37 -07:00
Roland McGrath a600e5cef5 Consolidate Linux and POSIX libc_fatal code. 2013-03-19 17:07:15 -07:00
Joseph Myers e97ed6ddbe Remove bp-sym.h and BP_SYM uses from C code. 2013-02-14 13:12:02 +00:00
Pino Toscano 92a601b883 ulimit: include <limits.h> 2013-01-23 17:27:45 +01:00
Pino Toscano 9cbbc4aebe ulimit: move linux implementation as posix
The linux implementation of ulimit works correctly and has nothing specific
to Linux, so move it as general posix implementation.
2013-01-23 17:25:53 +01:00
Joseph Myers 0e2f956295 Fix copyright notice corruption from update-copyright bug. 2013-01-02 19:28:45 +00:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Joseph Myers f4cf5f2d8b Add script to update copyright notices and reformat some to facilitate its use. 2013-01-01 16:29:10 +00:00
Siddhesh Poyarekar cfde9b463d Return EAI_SYSTEM if we're out of file descriptors
Resolves BZ #14719.
2012-11-19 13:02:48 +05:30
Joseph Myers 531f1ae0a7 Generate /usr/libexec/getconf files when cross-compiling. 2012-11-17 01:49:19 +00:00
Chris Metcalf 017678433c Suppress incorrect link warnings for NSS symbols
When glibc is built with --enable-static-nss, the warning that
using NSS symbols requires the nss shared objects to be present
is no longer true, as those symbols are built into libc.  Suppress
the warning for those symbols by providing a new macro
(nss_interface_function) for the NSS functions that is defined as
static_link_warning in the normal case, and empty for static NSS.
2012-10-30 14:14:33 -04:00
Roland McGrath 6e6249d0b4 BZ#14743: Move clock_* symbols from librt to libc. 2012-10-24 14:50:46 -07:00
Florian Weimer 172a631a1f __alloc_dir: avoid integer overflow in malloc argument 2012-10-16 10:33:50 +02:00
Pino Toscano 5bb0c10a8f sysconf/posix: handle _SC_LEVEL4_CACHE_LINESIZE 2012-10-03 22:57:38 +02:00
Roland McGrath ea4d37b316 Implement POSIX-generic sleep via nanosleep rather than SIGARLM. 2012-09-28 16:26:33 -07:00
Jeff Law 115411772b [BZ #11438]
* sysdeps/posix/getaddrinfo.c (default_scopes): Map RFC 1918
        * addresses
        to global scope.
        * posix/tst-rfc3484.c: Verify 10/8, 172.16/12 and 196.128/16
        addresses are in the same scope as 192.0.2/24.
        * posix/gai.conf: Document new scope table defaults.
2012-09-28 10:15:05 -06:00
Jeff Law 8479f23aa1 * sysdeps/posix/getaddrinfo.c (gaih_inet): Only use gethostbyname4_r
if the family is PF_UNSPEC.
2012-08-22 11:41:40 -06:00
Roland McGrath 7c6f9d53c1 Move some things from sysdeps/unix to sysdeps/posix. 2012-08-17 13:52:32 -07:00
Roland McGrath fbc723bb37 Fix typo in last change. 2012-08-17 11:49:00 -07:00
Roland McGrath a084405777 Fix getaddrinfo for [!_STATBUF_ST_NSEC] case. 2012-08-17 11:47:06 -07:00
Roland McGrath a3f95dcc57 Add casts to suppress warnings in system.c under [!_LIBC_REENTRANT]. 2012-08-15 10:08:32 -07:00
Roland McGrath a2433aac7e Add a missing #include. 2012-08-08 10:39:28 -07:00
Roland McGrath a281decc87 Move common dirent implementation from sysdeps/unix to sysdeps/posix. 2012-08-07 14:47:34 -07:00
Roland McGrath bea9b19322 Fix lots of bitrot for stub configurations. 2012-07-30 16:34:33 -07:00
Florian Weimer 84b3fd8407 Rename __secure_getenv to secure_getenv 2012-07-25 19:46:22 +02:00
Jeroen van Bemmel 7b6e99be77 Avoid duplicate DNS requests if answer is longer than a implementation
limit

        [BZ #14307]
        * sysdeps/posix/getaddrinfo.c (gaih_inet): Increase the size of
        the temporary buffer used to invoke __gethostbyname2_r,
        __gethostbyaddr_r and gethostbyname4_r to make room for struct
        host_data / struct gaih_addrtuple.
        * resolv/nss_dns/dns-host.c (global scope): Move definition of
        implementation constants MAX_NR_ALIASES and MAX_NR_ADDRS to
        header file nss/nsswitch.h.
        * nss/nsswitch.h (global scope): Add definition of implementation
        constants MAX_NR_ALIASES and MAX_NR_ADDRS (moved from
        resolv/nss_dns/dns-host.c).
2012-07-12 11:31:48 +05:30
Roland McGrath d6c33fda03 Switch gettimeofday from INTUSE to libc_hidden_proto. 2012-05-24 13:12:34 -07:00
Thomas Schwinge be971a2b1c Hurd: libc_once_get 2012-05-10 15:57:24 -07:00
Thomas Schwinge 37233df9d1 Hurd: #include <kernel-features.h> 2012-05-10 15:57:24 -07:00
Joseph Myers 4ad451e281 Move sysdeps/unix/sysv/gethostname.c to sysdeps/posix/. 2012-04-23 18:53:47 +00:00
Andreas Schwab 12e5c3b9e5 Add missing headers 2012-02-27 20:27:41 +01:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Joseph Myers c8a89e7dd5 Remove miscellaneous __STDC__ conditionals. 2012-01-30 21:20:32 +00:00
Ulrich Drepper 312be3f9f5 Clean up internal fopen uses
No need to ever not use c and e.
2011-11-15 04:24:42 -05:00
Ulrich Drepper 3a2c02424d Cache network interface information
Whenever getaddrinfo needed network interface information it used the
netlink interface to read the information every single time.  The
problem is that this information can change at any time.

The patch implements monitoring of the network interfaces through
nscd.  If no change is detected the previously read information can
be reused (which is the norm).  This timestamp information is also
made available to other processes using the shared memory segment
between nscd and those processes.
2011-10-31 01:51:16 -04:00
Roland McGrath ecb1482ffd Clean up disabling of script_execute 2011-09-19 12:50:25 -07:00
Ulrich Drepper d96de9634a Try shell in posix_spawn* only in compat mode 2011-09-05 20:24:50 -04:00
Andreas Schwab 2e96f1c73b Fix encoding name for IDN in getaddrinfo 2011-08-04 15:42:10 -04:00
Andreas Schwab 89f654c57b Make sure RES_USE_INET6 is always restored 2011-06-30 06:33:32 -04:00
Ulrich Drepper fa3fc0fe5f Avoid __check_pf calls in getaddrinfo unless really needed 2011-06-22 15:00:54 -04:00
Andreas Schwab e12df166d3 Fix Ipv4&IPv6 lookup in getaddrinfo
Problem introduced in the last patch.
2011-06-22 14:35:49 -04:00
Ulrich Drepper c0244a9ded Fix IPv6-only lookups through getaddrinfo
A recent patch introduced a problem where IPv6 lookups happily returned
IPv4 addresses.
2011-06-21 17:03:38 -04:00
Ulrich Drepper c5e3c2ae59 Minor optimization of getaddrinfo after recent patch 2011-06-21 13:06:42 -04:00
Ulrich Drepper 3154bfb8c7 Fix memory leak in getaddrinfo 2011-06-13 08:31:50 -04:00
Ulrich Drepper 7ae22829af Restore _res correctly
getaddrinfo works around the resolver functionality to avoid automatic
IPv6 lookups.  The restoring didn't allow for the resolver to set
additional bits in _res.
2011-05-29 23:49:49 -04:00
Ulrich Drepper 34a9094f49 Don't unconditionally use alloca in gaih_inet 2011-05-20 23:46:03 -04:00
Ulrich Drepper f8a3b5bf8f Use mmap for allocation of buffers used for __abort_msg 2011-05-15 00:34:48 -04:00
Ulrich Drepper f574184a0e Fix sched_setscheduler call in spawn implementation 2011-05-11 23:58:02 -04:00
Ulrich Drepper 6fb2dde3f1 Make complete getcwd work in rtld 2011-05-08 14:53:20 -04:00
Ulrich Drepper 7fb90fb89b Fix Linux getcwd for long paths
The getcwd syscall (so far?) can only handle path up to one page
in size.  There is no limit about directory hierarchy depth, though,
and the POSIX getcwd is supposed to handle this.  In that case fall
back to the generic getcwd.

Additionally, optimize the generic getcwd to use openat when possible
to change the asymptotic performance from O(N^2) to O(n).
2011-05-08 08:37:19 -04:00
Maciej Babinski 0b592a30f5 getaddrinfo(AF_INET6) does not return scope_id info provided by NSS modules 2011-05-02 21:11:17 -04:00
Ulrich Drepper 86e9235918 Fix decoding of canonical name in getaddrinfo. 2011-01-19 15:50:05 -05:00
Ulrich Drepper cfa28e560e Relax requirement on close in child created by posix_spawn. 2011-01-13 13:27:46 -05:00
Ulrich Drepper c3e2f19bb9 Add self-contained test for NSS.
While at it fix interaction between __nss_configure_lookup and nscd.
Otherwise the test fails if nscd is runnung.
2010-08-11 07:25:02 -07:00
Ulrich Drepper cb652f30b0 Handle POSIX-compliant errno value of unlink in remove. 2010-04-04 02:08:37 -07:00
Ulrich Drepper 07f9ca32a9 Fix one case of last checkin.
If the v4 lookup failed but v6 succeeded we treat this as a success.
2010-03-26 05:52:39 -07:00
Ulrich Drepper 7c9302908e Don't abort immediately on successful lookup in getaddrinfo.
When not using gethostbyname4 methods we immediately aborted the loop
over the nss modules on the first successful lookup.  While this is
almost always what is wanted the nsswitch.conf file allows to select
something different.
2010-03-26 05:40:27 -07:00
Andreas Schwab c3dfadb87e Fix spurious UNAVAIL status is getaddrinfo 2010-03-26 05:35:50 -07:00
Andreas Schwab 34b514dff6 Fix typo in cuserid 2010-03-25 11:36:02 +01:00
Jonathan Geisler fd8ccb0427 calls to cuserid() can result in buffer overruns and/or overflows 2010-03-24 16:02:15 -07:00
Ulrich Drepper a682a1bf55 Fix a few error cases in *name4_r lookup handling. 2009-12-10 15:44:26 -08:00
Ulrich Drepper 7f3146e789 Implement mkstemps and mkstemps64. 2009-10-30 00:11:07 -07:00
Ulrich Drepper 657317537c Handle missing NSS modules and those without callbacks.
getaddrinfo didn't update the status variable in that round of the
loop if no callback was used.
2009-07-25 12:29:04 -07:00
Ulrich Drepper 48dcd0ba84 Preserve message printed before abort.
The terminal output etc is not visible in a core file.  The new
libc-internal variable __abort_msg will point to a string with the
message which has been printed before the abort in case abort is
called from inside libc.  BZ #10217
2009-06-15 16:17:09 -07:00
Ulrich Drepper 7f8a28efb5 * sysdeps/unix/sysv/linux/preadv.c: The kernel API changed. Adjust.
* sysdeps/unix/sysv/linux/pwritev.c: Likewise.

2009-04-23  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/posix/pwritev.c (PWRITEV): Fix up comment.  Copy
	data from vector to temporary buffer and call PWRITEV after it
	instead of vice versa.
	* sysdeps/posix/preadv.c: Fix up comment.
	* misc/preadv.c: Likewise.
	* misc/preadv64.c: Likewise.
	* misc/pwritev.c: Likewise.
	* misc/pwritev64.c: Likewise.
	* misc/sys/uio.h (preadv, pwritev, preadv64, pwritev64): Likewise.

2009-04-23  Ulrich Drepper  <drepper@redhat.com>
2009-04-23 22:52:24 +00:00
Ulrich Drepper 571ac26f69 * sysdeps/posix/preadv.c: Reading of zero bytes is no error.
* sysdeps/posix/readv.c: Likewise.
	Reported by Markus Armbruster <armbru@redhat.com>.
2009-04-17 21:26:34 +00:00
Ulrich Drepper e109c6124f * misc/Makefile (routines): Add preadv, preadv64, pwritev, pwritev64.
* misc/Versions: Export preadv, preadv64, pwritev, pwritev64 for
	GLIBC_2.10.
	* misc/sys/uio.h: Declare preadv, preadv64, pwritev, pwritev64.
	* sysdeps/unix/sysv/linux/kernel-features.h: Add entries for preadv
	and pwritev.
	* misc/preadv.c: New file.
	* misc/preadv64.c: New file.
	* misc/pwritev.c: New file.
	* misc/pwritev64.c: New file.
	* sysdeps/posx/preadv.c: New file.
	* sysdeps/posx/preadv64.c: New file.
	* sysdeps/posx/pwritev.c: New file.
	* sysdeps/posx/pwritev64.c: New file.
	* sysdeps/unix/sysv/linux/preadv.c: New file.
	* sysdeps/unix/sysv/linux/preadv64.c: New file.
	* sysdeps/unix/sysv/linux/pwritev.c: New file.
	* sysdeps/unix/sysv/linux/pwritev64.c: New file.
	* sysdeps/unix/sysv/linux/wordsize-64/preadv64.c: New file.
	* sysdeps/unix/sysv/linux/wordsize-64/pwritev64.c: New file.
2009-04-03 19:57:16 +00:00
Ulrich Drepper 2dbe6afe7c * sysdeps/unix/sysv/linux/kernel-features.h: Define
__ASSUME_COMPLETE_READV_WRITEV.
	* sysdeps/unix/sysv/linux/readv.c: No need for userlevel fallback
	with modern kernels.
	* sysdeps/unix/sysv/linux/writev.c: Likewise.

	* sysdeps/posix/readv.c: Since read is a cancellation point we have
	to free a possible malloced buffer in case of cancellation.
	* sysdeps/posix/writev.c: Likewise for write.

c2009-04-01  Ulrich Drepper  <drepper@redhat.com>
2009-04-03 17:23:13 +00:00
Ulrich Drepper 67108e401f ..
2009-02-24  Ulrich Drepper  <drepper@redhat.com>

	* bits/confname.h: Define _SC_TRACE_EVENT_NAME_MAX, _SC_TRACE_NAME_MAX,
	_SC_TRACE_SYS_MAX, _SC_TRACE_USER_EVENT_MAX, _SC_XOPEN_STREAMS.
	* sysdeps/posix/sysconf.c (__sysconf): Handle
	_SC_TRACE_EVENT_NAME_MAX, _SC_TRACE_NAME_MAX, _SC_TRACE_SYS_MAX,
	_SC_TRACE_USER_EVENT_MAX, _SC_XOPEN_STREAMS.
2009-02-25 00:36:33 +00:00
Ulrich Drepper 26b62243ee [BZ #7095]
2009-02-06  Ulrich Drepper  <drepper@redhat.com>
	[BZ #7095]
	* bits/confname.h: Add SUSv7 macros for getconf environments.
	* bits/environments.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/bits/environments.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/environments.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/bits/environments.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/environments.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/bits/environments.h: Likewise.
	* posix/confstr.c: Handle SUSv5 and SUSv7 environments.
	* posix/getconf.c: Likewise.
	* posix/sysconf.c: Likewise.
	* sysdeps/posix/sysconf.c: Likewise.
	* posix/Makefile (getconf.speclist): Also collect SUSv5 and SUSv7
	environments.
2009-02-07 08:19:29 +00:00
Ulrich Drepper bfbbc63f04 * sysdeps/posix/getaddrinfo.c (gaih_inet): When the
gethostbyname4_r function call succeeded, just leave the loop.
2008-12-29 23:47:07 +00:00
Ulrich Drepper da5ac1352d * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): Recognize
ESRCH return value.
	(_nss_dns_gethostbyname4_r): Likewise.
	* resolv/res_init.c (__res_vinit): Initialize nscount to zero.
	* sysdeps/posix/getaddrinfo.c (gaih_inet): In case we use
	gethostbyname4_r, we don't have a separate IPv6 status, so copy
	the no_data variable.
2008-12-03 07:30:39 +00:00
Ulrich Drepper be4607eba8 * sysdeps/posix/getaddrinfo.c (getaddrinfo): Only restrict search
to IPv4 or IPv6 if an interface has been found.
2008-11-27 06:31:04 +00:00
Ulrich Drepper ca4dc0fe64 * sysdeps/posix/getaddrinfo.c (getaddrinfo): If the system has
neither IPv4 nor IPv6 addresses defined, don't do anything.
2008-11-27 00:25:32 +00:00
Ulrich Drepper 3501542f94 * sysdeps/posix/clock_getres.c (hp_timing_getres): Remove inline
to prevent warning.
2008-08-02 15:53:18 +00:00
Ulrich Drepper 3c22738644 * sysdeps/posix/getaddrinfo.c (gaih_inet): Raise size of initial
buffer passed to NSS functions.
2008-07-30 19:14:32 +00:00
Ulrich Drepper d0a1ae9464 * sysdeps/posix/getaddrinfo.c: Move _res_hconf_init call to a
better place so it is not called when nscd is used.
2008-06-13 23:35:47 +00:00
Ulrich Drepper 66d904966f * sysdeps/posix/getaddrinfo.c (gaih_inet): If nscd reports no
entry is available, believe it.
2008-05-17 21:44:56 +00:00
Ulrich Drepper 91c8a74b8b * sysdeps/posix/getaddrinfo.c (gaih_inet): After gethostbyname4_r
lookup, don't assign canon unconditionally.
2008-05-16 15:36:26 +00:00
Ulrich Drepper 5846c4e269 (match_prefix): Don't treat IPv4 loopback address special when
converting to v4 mapped addressed.
2008-05-14 22:47:15 +00:00
Ulrich Drepper 5fab55441c * sysdeps/posix/getaddrinfo.c (get_scope): Loopback addresses have
to be treated like link-local addresses.
2008-05-14 22:33:51 +00:00
Ulrich Drepper 1f0398248c * sysdeps/posix/getaddrinfo.c (getaddrinfo): Add _res_hconf_init
if necessary.
2008-05-14 21:53:48 +00:00
Ulrich Drepper 18a74157a6 * sysdeps/posix/getaddrinfo.c: Implement handling of DCCP, UDPlite,
and SCTP.
2008-05-14 17:55:57 +00:00
Ulrich Drepper 372bfcac73 * sysdeps/posix/getaddrinfo.c: Implement handling of DCCP and
UDPlite.

	* nss/getent.c (ahosts_keys_int): Handle all known socket types.

	* inet/netinet/in.h (IPPIPPROTO_DCCP, IPPROTO_UDPLITE): Define.

	* sysdeps/unix/sysv/linux/bits/socket.h (SOCK_DCCP): Define.
2008-05-14 17:33:37 +00:00
Ulrich Drepper 1eb946b935 * include/resolv.h: Adjust __libc_res_nquery and __libc_res_nsend
prototypes.
	* include/arpa/nameser_compat.h: Define T_UNSPEC.
	* nis/Versions (libnss_nis): Export _nss_nis_gethostbyname4_r.
	(libnss_nisplus): Export _nss_nisplus_gethostbyname4_r.
	* nis/nss_nis/nis-hosts.c (LINE_PARSER): Change to also handle
	af==AF_UNSPEC.
	(_nss_nis_gethostbyname4_r): New function.
	* nis/nss_nisplus/nisplus-hosts.c (_nss_nisplus_parse_hostent):
	Change to also handle af==AF_UNSPEC.
	(get_tablename): New function.  Use it to avoid duplication.
	(_nss_nisplus_gethostbyname4_r): New function.
	* nscd/aicache.c (addhstaiX): Use gethostbyname4_r function is
	available.
	* nss/Versions (libnss_files): Export _nss_files_gethostbyname4_r.
	* nss/nss.h: Define struct gaih_addrtuple.
	* nss/nss_files/files-hosts.c (LINE_PARSER): Change to also handle
	af==AF_UNSPEC.
	(_nss_files_gethostbyname4_r): New function.
	* resolv/Versions (libnss_dns): Export _nss_dns_gethostbyname4_r.
	* resolv/gethnmaddr.c: Adjust __libc_res_nsearch and __libc_res_nquery
	calls.
	* resolv/res_query.c (__libc_res_nquery): Take two additional
	parameters for second answer buffer.  Handle type=T_UNSPEC to mean
	look up IPv4 and IPv6.
	Change all callers.
	* resolv/res_send.c (__libc_res_nsend): Take five aditional parameters
	for an additional query and answer buffer.  Pass to send_vc and
	send_dg.
	(send_vc): Send possibly two requests and receive two answers.
	(send_dg): Likewise.
	* resolv/nss_dns/dns-host.c: Adjust calls to __libc_res_nsearch and
	__libc_res_nquery.
	(_nss_dns_gethostbyname4_r): New function.
	(gaih_getanswer_slice): Likewise.
	(gaih_getanswer): Likewise.
	* resolv/nss_dns/dns-canon.c (_nss_dns_getcanonname_r): Adjust
	__libc_res_nquery call.
	* resolv/nss_dns/dns-network.c (_nss_dns_getnetbyaddr_r): Likewise.
	(_nss_dns_getnetbyname_r): Adjust __libc_res_nsearch call.
	* sysdeps/posix/getaddrinfo.c: Use gethostbyname4_r function is
	available.
2008-05-10 23:27:39 +00:00
Ulrich Drepper e8a3212650 [BZ #5939]
* sysdeps/posix/tempname.c (__gen_tempname): Correct flag selection.
2008-03-30 03:30:38 +00:00
Ulrich Drepper fde15fdc5b * posix/gai.conf: Fix comment for scope nullbits.
* sysdeps/posix/getaddrinfo.c (gaiconf_init): If /bits is not present,
	default to 128 bits for v4 mapped addresses.
2008-03-26 17:45:14 +00:00
Ulrich Drepper 72e6cdfa2c Remove useless "if" before "free". 2008-03-19 06:43:34 +00:00
Ulrich Drepper 6107639e64 * sysdeps/posix/getaddrinfo.c (default_labels): Adjust for change
of names of in in6_addr.
	(default_precedence): Likewise.
	* sysdeps/unix/sysv/linux/cmsg_nxthdr.c: Include <stddef.h> for
	NULL definition.
2008-01-16 19:47:17 +00:00
Ulrich Drepper 49029a669d * sysdeps/posix/getaddrinfo.c (rfc3484_sort): Store result of
native interface lookup in all the relevant places.
2008-01-10 22:30:58 +00:00
Ulrich Drepper 0efd19566d * sysdeps/posix/getaddrinfo.c (sort_results): Remove service_order
field.  Use sockaddr_in6 for source_addr.
	(get_scope): Change type of parameter to sockaddr_in6.  Adjust.
	(match_prefix): Likewise.
	(get_label): Likewise.
	(get_precedence): Likewise.
	(rfc3484_sort): Change to use indirect access to results array.
	Adjust to use of sockaddr_in6.  Replace service_order test with
	simple index comparison.
	(getaddrinfo): Define order array.  Initialize it.  Don't initialize
	service_order field.  Adjust qsort_t calls.  Access sorted result
	array indirectly through order array.
	* posix/tst-rfc3484.c: Adjust for change of rfc3484_sort.
	* posix/tst-rfc3484-2.c: Likewise.
	* posix/tst-rfc3484-3.c: Likewise.
2008-01-10 20:00:52 +00:00
Ulrich Drepper ee72b97189 * sysdeps/posix/getaddrinfo.c (defaults_scopes, scopes): New variables.
(get_scope): For IPv4 scope, use scopes table.
	(fini): Free scopes table if necessary.
	(free_scopelist): New function.
	(scopecmp): New function.
	(gaiconf_init): Also handle scopev4 entries.
	* posix/tst-rfc3484.c (do_test): Initialize scopes.
	* posix/tst-rfc3484-2.c (do_test): Likewise.
	* posix/gai.conf: Document scopev4 defaults.
	* posix/Makefile (tests): Add tst-rfc3484-3.
	* posix/tst-rfc3484-3.c: New file.
2007-11-20 00:41:22 +00:00
Ulrich Drepper f4a7976578 * sysdeps/posix/getaddrinfo.c (default_labels): Describe entry for
Teredo tunnels.
2007-11-19 17:31:40 +00:00
Ulrich Drepper 773e79b316 * include/ifaddrs.h: Remove in6ai_temporary.
(struct in6addrinfo): Add index element.
	Declare __check_native.
	* inet/Makefile (aux): Add check_native.
	* sysdeps/unix/sysv/linux/check_native.c: New file.
	* sysdeps/unix/sysv/linux/check_pf.c: No need to recognize
	IFA_F_TEMPORARY.  Pass back ifa_index.
	* sysdeps/posix/getaddrinfo.c: Remove netlink compatibility code.
	(rfc3484_sort): Add new parameter.  Implement rule 7 correctly:
	call __check_native if necessary.
	(getaddrinfo): Fill in index field.  Use qsort_r instead of qsort
	to sort addresses.  Pass information about the results.
	* posix/tst-rfc3484.c: Adjust for addition of index field and change
	of rfc3484_sort interface.
	* posix/tst-rfc3484-2.c: Likewise.
2007-11-14 06:58:35 +00:00
Ulrich Drepper 6f3914d5a3 * include/ifaddrs.c (struct in6addrinfo): Add prefixlen field.
* sysdeps/unix/sysv/linux/check_pf.c (make_request): Always return
	list of interfaces.  Also store prefix length.
	* sysdeps/posix/getaddrinfo.c (sort_result): Add prefixlen element.
	(rfc3484_sort): In rule 9, for IPv4 addresses count only matching
	prefix if source and destination address are in the same subnet.
	(getaddrinfo): Always call __check_pf.  Fill in prefixlen field.
	Always look for matching record in in6ai list.
	Correct source_addr_len value for IPv6->IPv4 converted records.
2007-11-12 23:55:58 +00:00
Ulrich Drepper fc4837e5d7 * sysdeps/posix/getaddrinfo.c (getaddrinfo): When sorting addresses
and admin selects to be able to replace the gai.conf file, lock
	data structures around the qsort call.
2007-10-17 16:05:34 +00:00
Ulrich Drepper 6f55ed8885 * sysdeps/posix/getaddrinfo.c (struct sort_result): Add
service_order.
	(rfc3484_sort): Make sure that even of qsort doesn't support
	stable sorting it is stable by comparing service_order.
	(getaddrinfo): Initialize service_order.
2007-10-14 17:58:03 +00:00
Jakub Jelinek e6eec9cef2 * sysdeps/posix/getaddrinfo.c (getaddrinfo): Use
close_not_cancel_no_status instead of close.
2007-09-24  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Use
	close_not_cancel_no_status instead of close.
2007-09-24 15:18:25 +00:00
Ulrich Drepper e1db0493fd * sysdeps/posix/getaddrinfo.c (getaddrinfo): Avoid unnecessary
open/close when determining source addresses.
2007-09-19 22:12:22 +00:00