Skip to content

Commit

Permalink
update master-with-bazel from master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
BoringSSL Robot committed Jan 4, 2017
2 parents faa0d0d + bf5bda3 commit 886e7d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/tool/transport_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ bool Accept(int *out_sock, const std::string &port) {
addr.sin6_port = htons(atoi(port.c_str()));

bool ok = false;
const char enable = 1;
int server_sock = -1;

server_sock =
Expand All @@ -168,6 +169,12 @@ bool Accept(int *out_sock, const std::string &port) {
goto out;
}

if (setsockopt(server_sock, SOL_SOCKET, SO_REUSEADDR, &enable,
sizeof(enable)) < 0) {
perror("setsockopt");
goto out;
}

if (bind(server_sock, (struct sockaddr*)&addr, sizeof(addr)) != 0) {
perror("connect");
goto out;
Expand Down

0 comments on commit 886e7d7

Please sign in to comment.