diff --git a/src/net/socket/tcp_socket_posix.cc b/src/net/socket/tcp_socket_posix.cc index 4a7091cd67..70d853eba8 100644 --- a/src/net/socket/tcp_socket_posix.cc +++ b/src/net/socket/tcp_socket_posix.cc @@ -387,6 +387,17 @@ int TCPSocketPosix::GetPeerAddress(IPEndPoint* address) const { int TCPSocketPosix::SetDefaultOptionsForServer() { DCHECK(socket_); + +#if BUILDFLAG(IS_LINUX) + int reuseport = 1; + int rv = + setsockopt(socket_->socket_fd(), SOL_SOCKET, SO_REUSEPORT, + reinterpret_cast(&reuseport), sizeof(reuseport)); + if (rv < 0) { + return MapSystemError(errno); + } +#endif + return AllowAddressReuse(); }