mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
_gethostbynis{addr,name}() can handle an IPv6, now.
This commit is contained in:
parent
0c3757df94
commit
7b671d902b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=145632
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user