diff options
author | ume <ume@FreeBSD.org> | 2005-04-28 17:44:44 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2005-04-28 17:44:44 +0000 |
commit | f40143a00f8fc4b5f2ff3e33c4cb36e011f65b40 (patch) | |
tree | ece087f9bcb557d697f21b9d5f506da519174ed6 /lib | |
parent | e7621e180436fd26fd60f4e550485c8f99a7c0b0 (diff) | |
download | FreeBSD-src-f40143a00f8fc4b5f2ff3e33c4cb36e011f65b40.zip FreeBSD-src-f40143a00f8fc4b5f2ff3e33c4cb36e011f65b40.tar.gz |
_gethostbynis{addr,name}() can handle an IPv6, now.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/net/name6.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c index 4281015..9df7842 100644 --- a/lib/libc/net/name6.c +++ b/lib/libc/net/name6.c @@ -1387,17 +1387,14 @@ _nis_ghbyname(void *rval, void *cb_data, va_list ap) af = va_arg(ap, int); errp = va_arg(ap, int *); - if (af == AF_INET) { - THREAD_LOCK(); - hp = _gethostbynisname(name, af); - if (hp != NULL) - hp = _hpcopy(hp, errp); - THREAD_UNLOCK(); - } - + THREAD_LOCK(); + hp = _gethostbynisname(name, af); + if (hp != NULL) + hp = _hpcopy(hp, errp); + THREAD_UNLOCK(); + *(struct hostent **)rval = hp; return (hp != NULL) ? NS_SUCCESS : NS_NOTFOUND; - } static int @@ -1413,13 +1410,11 @@ _nis_ghbyaddr(void *rval, void *cb_data, va_list ap) addrlen = va_arg(ap, int); af = va_arg(ap, int); - if (af == AF_INET) { - THREAD_LOCK(); - hp = _gethostbynisaddr(addr, addrlen, af); - if (hp != NULL) - hp = _hpcopy(hp, errp); - THREAD_UNLOCK(); - } + THREAD_LOCK(); + hp = _gethostbynisaddr(addr, addrlen, af); + if (hp != NULL) + hp = _hpcopy(hp, errp); + THREAD_UNLOCK(); *(struct hostent **)rval = hp; return (hp != NULL) ? NS_SUCCESS : NS_NOTFOUND; } |