Skip to content
Snippets Groups Projects
Commit 2c779d64 authored by David G. Quintas's avatar David G. Quintas Committed by GitHub
Browse files

Merge pull request #7675 from y-zeng/AF_unix_so_reuseport

Disable SO_REUSEPORT for AF_UNIX
parents e49a0017 2414bbb9
No related branches found
No related tags found
No related merge requests found
......@@ -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++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment