mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
Add set_sockaddr_port function for winbindd.
Jeremy.
(This used to be commit 4b47052694
)
This commit is contained in:
@ -627,6 +627,19 @@ static int get_socket_port(int fd)
|
||||
}
|
||||
#endif
|
||||
|
||||
void set_sockaddr_port(struct sockaddr_storage *psa, uint16 port)
|
||||
{
|
||||
#if defined(HAVE_IPV6)
|
||||
if (psa->ss_family == AF_INET6) {
|
||||
((struct sockaddr_in6 *)psa)->sin6_port = htons(port);
|
||||
}
|
||||
#else
|
||||
if (psa->ss_family == AF_INET) {
|
||||
((struct sockaddr_in *)psa)->sin_port = htons(port);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *client_name(int fd)
|
||||
{
|
||||
return get_peer_name(fd,false);
|
||||
|
Reference in New Issue
Block a user