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:
@@ -5452,9 +5452,13 @@ init_hasreuseport() {
|
|||||||
#if defined(SO_REUSEPORT) && defined(__linux__)
|
#if defined(SO_REUSEPORT) && defined(__linux__)
|
||||||
int sock, yes = 1;
|
int sock, yes = 1;
|
||||||
sock = socket(AF_INET, SOCK_DGRAM, 0);
|
sock = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
|
if (sock < 0) {
|
||||||
|
sock = socket(AF_INET6, SOCK_DGRAM, 0);
|
||||||
if (sock < 0) {
|
if (sock < 0) {
|
||||||
return;
|
return;
|
||||||
} else if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
|
}
|
||||||
|
}
|
||||||
|
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
|
||||||
(void *)&yes, sizeof(yes)) < 0)
|
(void *)&yes, sizeof(yes)) < 0)
|
||||||
{
|
{
|
||||||
close(sock);
|
close(sock);
|
||||||
|
Reference in New Issue
Block a user