1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

on sco2 socketpair_tcp needs a bind

This commit is contained in:
Andrew Tridgell 0001-01-01 00:00:00 +00:00
parent 87f90d48d8
commit d8e5409ebb

View File

@ -1158,6 +1158,7 @@ static int socketpair_tcp(int fd[2])
{
int listener;
struct sockaddr sock;
struct sockaddr_in sock2;
socklen_t socklen = sizeof(sock);
int connect_done = 0;
@ -1167,6 +1168,14 @@ static int socketpair_tcp(int fd[2])
if ((listener = socket(PF_INET, SOCK_STREAM, 0)) == -1) goto failed;
memset(&sock2, 0, sizeof(sock2));
#ifdef HAVE_SOCK_SIN_LEN
sock2.sin_len = sizeof(sock2);
#endif
sock2.sin_family = PF_INET;
bind(listener, (struct sockaddr *)&sock2, sizeof(sock2));
if (listen(listener, 1) != 0) goto failed;
if (getsockname(listener, &sock, &socklen) != 0) goto failed;