mirror of
https://github.com/samba-team/samba.git
synced 2025-12-12 12:23:50 +03:00
Fix Solaris by ensuring we use the IPv4 or IPv6 length
in any getnameinfo calls. Jeremy
This commit is contained in:
@@ -2545,3 +2545,27 @@ int sys_getpeereid( int s, uid_t *uid)
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
int sys_getnameinfo(const struct sockaddr *psa,
|
||||
socklen_t salen,
|
||||
char *host,
|
||||
size_t hostlen,
|
||||
char *service,
|
||||
size_t servlen,
|
||||
int flags)
|
||||
{
|
||||
/*
|
||||
* For Solaris we must make sure salen is the
|
||||
* correct length for the incoming sa_family.
|
||||
*/
|
||||
|
||||
if (salen == sizeof(struct sockaddr_storage)) {
|
||||
salen = sizeof(struct sockaddr_in);
|
||||
#if defined(HAVE_IPV6)
|
||||
if (psa->sa_family == AF_INET6) {
|
||||
salen = sizeof(struct sockaddr_in6);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return getnameinfo(psa, salen, host, hostlen, service, servlen, flags);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user