Merge pull request #7675 from y-zeng/AF_unix_so_reuseport

Disable SO_REUSEPORT for AF_UNIX
pull/7704/head^2
David G. Quintas 9 years ago committed by GitHub
commit 2c779d64db
  1. 5
      src/core/lib/iomgr/tcp_server_posix.c

@ -308,7 +308,7 @@ static grpc_error *prepare_socket(int fd, const struct sockaddr *addr,
GPR_ASSERT(fd >= 0);
if (so_reuseport) {
if (so_reuseport && !grpc_is_unix_socket(addr)) {
err = grpc_set_socket_reuse_port(fd, 1);
if (err != GRPC_ERROR_NONE) goto error;
}
@ -693,7 +693,8 @@ void grpc_tcp_server_start(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s,
s->pollset_count = pollset_count;
sp = s->head;
while (sp != NULL) {
if (s->so_reuseport && pollset_count > 1) {
if (s->so_reuseport && !grpc_is_unix_socket(&sp->addr.sockaddr) &&
pollset_count > 1) {
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"clone_port", clone_port(sp, (unsigned)(pollset_count - 1))));
for (i = 0; i < pollset_count; i++) {

Loading…
Cancel
Save