Allow SetSocketDualStack to be overridden internally.

PiperOrigin-RevId: 648387426
pull/37102/head
Vignesh Babu 7 months ago committed by Copybara-Service
parent 74b7c7248b
commit d879c3cb6a
  1. 10
      src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc
  2. 2
      src/core/lib/event_engine/posix_engine/tcp_socket_utils.h

@ -148,15 +148,21 @@ absl::Status PrepareTcpClientSocket(PosixSocketWrapper sock,
return absl::OkStatus();
}
#endif // GRPC_POSIX_SOCKET_UTILS_COMMON
} // namespace
#ifdef GRPC_POSIX_SOCKET_UTILS_COMMON
#ifndef GRPC_SET_SOCKET_DUALSTACK_CUSTOM
bool SetSocketDualStack(int fd) {
const int off = 0;
return 0 == setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &off, sizeof(off));
}
#endif // GRPC_SET_SOCKET_DUALSTACK_CUSTOM
#endif // GRPC_POSIX_SOCKET_UTILS_COMMON
} // namespace
PosixTcpOptions TcpOptionsFromEndpointConfig(const EndpointConfig& config) {
void* value;
PosixTcpOptions options;

@ -323,6 +323,8 @@ struct PosixSocketWrapper::PosixSocketCreateResult {
EventEngine::ResolvedAddress mapped_target_addr;
};
bool SetSocketDualStack(int fd);
} // namespace experimental
} // namespace grpc_event_engine

Loading…
Cancel
Save