diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-01-12 11:39:14 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-01-12 11:39:14 +0000 |
commit | ce75c139ac162cf8d7d4a7598503bc3592328b2c (patch) | |
tree | 604f258eac5abfa916634aa002e6fd6bcc35fa82 /nss/getent.c | |
parent | 2e8048e533cf8f9ce23400c261cd8528cf37af5e (diff) | |
download | glibc-ce75c139ac162cf8d7d4a7598503bc3592328b2c.tar glibc-ce75c139ac162cf8d7d4a7598503bc3592328b2c.tar.gz glibc-ce75c139ac162cf8d7d4a7598503bc3592328b2c.tar.bz2 glibc-ce75c139ac162cf8d7d4a7598503bc3592328b2c.zip |
Update.
2000-01-12 Ulrich Drepper <drepper@cygnus.com>
* iconvdata/gconv-modules: Add aliases ISO-IR-199 and ISO-IR-203.
Reported by Bruno Haible <haible@ilog.fr>.
2000-01-11 Andreas Schwab <schwab@suse.de>
* sysdeps/i386/fpu/libm-test-ulps: Adjust some epsilons.
2000-01-10 Thorsten Kukuk <kukuk@suse.de>
* nss/getent.c: Add ipv6 support for hosts.
2000-01-05 Philip Blundell <pb@futuretv.com>
* sysdeps/unix/sysv/linux/arm/Versions: Add getrlimit, setrlimit,
getrlimit64, setrlimit64 for GLIBC_2.1.3.
* sysdeps/unix/sysv/linux/arm/syscalls.list: Add oldgetrlimit,
oldsetrlimit.
* sysdeps/unix/sysv/linux/arm/oldsetrlimit64.c: New file.
* sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/arm/setrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/arm/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/arm/setrlimit.c: Likewise.
* sysdeps/unix/sysv/linux/arm/getrlimit.c: Likewise.
* sysdeps/unix/sysv/linux/arm/Makefile [subdir=resource]
(sysdep_routines): Add oldgetrlimit64, oldsetrlimit64.
[subdir=misc] (sysdep_headers): Add sys/elf.h.
2000-01-09 Andreas Jaeger <aj@suse.de>
* manual/install.texi (Tools for Compilation): Update required
compiler version.
(Configuring and compiling): Restore old comments about
configparms; modify to reflect current usage.
2000-01-09 Philip Blundell <philb@gnu.org>
* sysdeps/posix/getaddrinfo.c (gaih_inet): Don't attempt name
resolution if the hints included AI_NUMERICHOST.
Diffstat (limited to 'nss/getent.c')
-rw-r--r-- | nss/getent.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/nss/getent.c b/nss/getent.c index 1ced537805..02f2034efb 100644 --- a/nss/getent.c +++ b/nss/getent.c @@ -1,6 +1,6 @@ -/* Copyright (c) 1998, 1999 Free Software Foundation, Inc. +/* Copyright (c) 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998. + Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -35,6 +35,7 @@ #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> +#include <arpa/nameser.h> /* Get libc version number. */ #include <version.h> @@ -251,7 +252,9 @@ static inline void print_hosts (struct hostent *host) { unsigned int i; - char *ip = inet_ntoa(* (struct in_addr *) host->h_addr_list[0]); + char buf[INET6_ADDRSTRLEN]; + const char *ip = inet_ntop (host->h_addrtype, host->h_addr_list[0], + buf, sizeof (buf)); fputs (ip, stdout); for (i = strlen (ip); i < 16; ++i) @@ -276,18 +279,22 @@ hosts_keys (int number, char *key[]) for (i = 0; i < number; ++i) { - struct hostent *host; + struct hostent *host = NULL; - if (isdigit (key[i][0])) + if (strchr (key[i], ':') != NULL) { - struct in_addr addr; - addr.s_addr = inet_addr (key[i]); - - host = gethostbyaddr ((char *)&addr, sizeof (struct in_addr), - AF_INET); + char addr[IN6ADDRSZ]; + if (inet_pton (AF_INET6, key[i], &addr)) + host = gethostbyaddr (addr, sizeof (addr), AF_INET6); } - else - host = gethostbyname (key[i]); + else if (isdigit (key[i][0])) + { + char addr[INADDRSZ]; + if (inet_pton (AF_INET, key[i], &addr)) + host = gethostbyaddr (addr, sizeof (addr), AF_INET); + } + else if ((host = gethostbyname2 (key[i], AF_INET6)) == NULL) + host = gethostbyname2 (key[i], AF_INET); if (host == NULL) result = 2; |