2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 15:05:23 +00:00

handle systems without IPv4

This commit is contained in:
Mark Andrews
2018-11-19 12:27:56 +11:00
parent 1634592c99
commit 509dad8737

View File

@@ -5452,9 +5452,13 @@ init_hasreuseport() {
#if defined(SO_REUSEPORT) && defined(__linux__)
int sock, yes = 1;
sock = socket(AF_INET, SOCK_DGRAM, 0);
if (sock < 0) {
sock = socket(AF_INET6, SOCK_DGRAM, 0);
if (sock < 0) {
return;
} else if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
}
}
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
(void *)&yes, sizeof(yes)) < 0)
{
close(sock);