2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +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

@@ -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;