Skip to content

Commit

Permalink
Disable IPV6_V6ONLY on IPv6 server sockets on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Nov 10, 2020
1 parent c866870 commit 6a2dba9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tdutils/td/utils/port/ServerSocketFd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,11 @@ Result<ServerSocketFd> ServerSocketFd::open(int32 port, CSlice addr) {
setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, reinterpret_cast<const char *>(&flags), sizeof(flags));
#endif
#elif TD_PORT_WINDOWS
BOOL flags = TRUE;
BOOL flags = FALSE;
if (address.is_ipv6()) {
setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, reinterpret_cast<const char *>(&flags), sizeof(flags));
}
flags = TRUE;
#endif
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<const char *>(&flags), sizeof(flags));
setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, reinterpret_cast<const char *>(&flags), sizeof(flags));
Expand Down

0 comments on commit 6a2dba9

Please sign in to comment.