1
0
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:
Jeremy Allison
2007-11-02 10:25:34 -07:00
parent 8c73e19f51
commit 4d7badb0c4
4 changed files with 43 additions and 7 deletions

View File

@@ -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);
}