patch xtrans.diff

This commit is contained in:
2024-12-21 22:07:04 +08:00
parent 7cbad9fe2e
commit 826d8b6ef6
2 changed files with 6 additions and 4 deletions

View File

@@ -1233,9 +1233,9 @@ TRANS(MakeAllCOTSServerListeners) (const char *port, int *partial,
continue;
}
#if defined(IPv6) && defined(AF_INET6)
if ((Xtransports[i].transport_id == TRANS_SOCKET_INET_INDEX
&& ipv6_succ))
flags |= ADDR_IN_USE_ALLOWED;
// if ((Xtransports[i].transport_id == TRANS_SOCKET_INET_INDEX
// && ipv6_succ))
// flags |= ADDR_IN_USE_ALLOWED;
#endif
if ((status = TRANS(CreateListener (ciptr, port, flags))) < 0)

View File

@@ -640,7 +640,7 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, const char *protocol,
* Using this prevents the bind() check for an existing server listening
* on the same port, but it is required for other reasons.
*/
#ifdef SO_REUSEADDR
#if 1 //#ifdef SO_REUSEADDR
/*
* SO_REUSEADDR only applied to AF_INET && AF_INET6
@@ -655,6 +655,8 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, const char *protocol,
int one = 1;
setsockopt (ciptr->fd, SOL_SOCKET, SO_REUSEADDR,
(char *) &one, sizeof (int));
setsockopt (ciptr->fd, SOL_SOCKET, SO_REUSEPORT,
(char *) &one, sizeof (int));
}
#endif
#ifdef IPV6_V6ONLY