Commit 509dad87 authored by Mark Andrews's avatar Mark Andrews
Browse files

handle systems without IPv4

parent 1634592c
Pipeline #7168 passed with stages
in 27 minutes and 12 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