Commit 4f075d86 authored by Mark Andrews's avatar Mark Andrews
Browse files

Merge branch '729-init_hasreuseport-will-not-work-on-systems-w-o-ipv4' into 'master'

Resolve "init_hasreuseport will not work on systems w/o IPv4"

Closes #729

See merge request !1126
parents 1634592c 509dad87
Pipeline #7172 passed with stages
in 23 minutes and 16 seconds
......@@ -5453,9 +5453,13 @@ init_hasreuseport() {
int sock, yes = 1;
sock = socket(AF_INET, SOCK_DGRAM, 0);
if (sock < 0) {
return;
} else if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
(void *)&yes, sizeof(yes)) < 0)
sock = socket(AF_INET6, SOCK_DGRAM, 0);
if (sock < 0) {
return;
}
}
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
(void *)&yes, sizeof(yes)) < 0)
{
close(sock);
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment