Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* sysdeps/posix/getaddrinfo.c: Implement configuration file
	handling.  /etc/gai.conf can contain replacements for the label
	and precedence table.  Fix byte order of default label and
	precedence table.
	* posix/gai.conf: New file.
	* posix/tst-rfc3484.c: Adjust for changes to getaddrinfo.c.
	* posix/tst-rfc3484-2.c: Likewise.
  • Loading branch information
Ulrich Drepper committed May 4, 2006
1 parent 5631e74 commit 77dd4c3
Show file tree
Hide file tree
Showing 6 changed files with 456 additions and 36 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
@@ -1,3 +1,13 @@
2006-05-03 Ulrich Drepper <drepper@redhat.com>

* sysdeps/posix/getaddrinfo.c: Implement configuration file
handling. /etc/gai.conf can contain replacements for the label
and precedence table. Fix byte order of default label and
precedence table.
* posix/gai.conf: New file.
* posix/tst-rfc3484.c: Adjust for changes to getaddrinfo.c.
* posix/tst-rfc3484-2.c: Likewise.

2006-05-02 Ulrich Drepper <drepper@redhat.com> 2006-05-02 Ulrich Drepper <drepper@redhat.com>


[BZ #1201] [BZ #1201]
Expand Down
6 changes: 3 additions & 3 deletions ChangeLog.5
Expand Up @@ -6911,9 +6911,9 @@ Sat Sep 30 11:47:05 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>


Fri Sep 29 15:07:10 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de> Fri Sep 29 15:07:10 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>


* sysdeps/unix/sysv/linux/adjtime.c (__adjtime): * sysdeps/unix/sysv/linux/adjtime.c (__adjtime):
Change name of field `mode' in `struct timex' to `modes'. Change name of field `mode' in `struct timex' to `modes'.
Linux-1.3.28 updates this name according to RFC 1489. Linux-1.3.28 updates this name according to RFC 1589.


Thu Sep 28 13:05:54 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> Thu Sep 28 13:05:54 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>


Expand Down
40 changes: 40 additions & 0 deletions posix/gai.conf
@@ -0,0 +1,40 @@
# Configuration for getaddrinfo(3).
#
# So far only configuration for the destination address sorting is needed.
# RFC 3484 governs the sorting. But the RFC also says that system
# administrators should be able to overwrite the defaults. This can be
# achieved here.
#
# All lines have an initial identifier specifying the option followed by
# up to two values. Information specified in this file replaces the
# default information. Complete absence of data of one kind causes the
# appropriate default information to be used. The supported commands include:
#
# reload <yes|no>
# If set to yes, each getaddrinfo(3) call will check whether this file
# changed and if necessary reload. This option should not really be
# used. There are possible runtime problems. The default is no.
#
# label <mask> <value>
# Add another rule to the RFC 3484 label table. See section 2.1 in
# RFC 3484. The default is:
#
#label ::1/128 0
#label ::/0 1
#label 2002::/16 2
#label ::/96 3
#label ::ffff:0:0/96 4
#
# precedence <mask> <value>
# Add another rule the to RFC 3484 precendence table. See section 2.1
# and 10.3 in RFC 3484. The default is:
#
#precendence ::1/128 50
#precendence ::/0 40
#precendence 2002::/16 30
#precendence ::/96 20
#precendence ::ffff:0:0/96 10
#
# For sites which prefer IPv4 connections change the last line to
#
#precendence ::ffff:0:0/96 100
12 changes: 12 additions & 0 deletions posix/tst-rfc3484-2.c
Expand Up @@ -45,9 +45,21 @@ service_user *__nss_hosts_database attribute_hidden;
#endif #endif




ssize_t
__getline (char **lineptr, size_t *n, FILE *s)
{
*lineptr = NULL;
*n = 0;
return 0;
}


static int static int
do_test (void) do_test (void)
{ {
labels = default_labels;
precedence = default_precedence;

struct sockaddr_in so1; struct sockaddr_in so1;
so1.sin_family = AF_INET; so1.sin_family = AF_INET;
so1.sin_addr.s_addr = h (0xc0a85f19); so1.sin_addr.s_addr = h (0xc0a85f19);
Expand Down
12 changes: 12 additions & 0 deletions posix/tst-rfc3484.c
Expand Up @@ -64,9 +64,21 @@ static int expected[naddrs] =
}; };




ssize_t
__getline (char **lineptr, size_t *n, FILE *s)
{
*lineptr = NULL;
*n = 0;
return 0;
}


static int static int
do_test (void) do_test (void)
{ {
labels = default_labels;
precedence = default_precedence;

struct sockaddr_in so; struct sockaddr_in so;
so.sin_family = AF_INET; so.sin_family = AF_INET;
so.sin_addr.s_addr = h (0xc0a85f19); so.sin_addr.s_addr = h (0xc0a85f19);
Expand Down

0 comments on commit 77dd4c3

Please sign in to comment.