summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/name6.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2005-04-28 17:44:44 +0000
committerume <ume@FreeBSD.org>2005-04-28 17:44:44 +0000
commitf40143a00f8fc4b5f2ff3e33c4cb36e011f65b40 (patch)
treeece087f9bcb557d697f21b9d5f506da519174ed6 /lib/libc/net/name6.c
parente7621e180436fd26fd60f4e550485c8f99a7c0b0 (diff)
downloadFreeBSD-src-f40143a00f8fc4b5f2ff3e33c4cb36e011f65b40.zip
FreeBSD-src-f40143a00f8fc4b5f2ff3e33c4cb36e011f65b40.tar.gz
_gethostbynis{addr,name}() can handle an IPv6, now.
Diffstat (limited to 'lib/libc/net/name6.c')
-rw-r--r--lib/libc/net/name6.c27
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;
}
OpenPOWER on IntegriCloud