]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Don't try to set IPV6_V6ONLY on OpenBSD
authorMark Andrews <marka@isc.org>
Thu, 28 Apr 2022 08:08:58 +0000 (18:08 +1000)
committerMark Andrews <marka@isc.org>
Mon, 2 May 2022 04:09:31 +0000 (14:09 +1000)
OpenBSD IPv6 sockets are always IPv6-only, so the socket option is read-only (not modifiable)

lib/isc/unix/socket.c

index 280678d9b8cbaaef58357a5a2283142b278e9621..5f94195b17028e488d67eea674b05c99ed90c3d6 100644 (file)
@@ -5091,7 +5091,7 @@ isc_socket_gettype(isc_socket_t *sock) {
 
 void
 isc_socket_ipv6only(isc_socket_t *sock, bool yes) {
-#if defined(IPV6_V6ONLY)
+#if defined(IPV6_V6ONLY) && !defined(__OpenBSD__)
        int onoff = yes ? 1 : 0;
 #else  /* if defined(IPV6_V6ONLY) */
        UNUSED(yes);
@@ -5101,7 +5101,7 @@ isc_socket_ipv6only(isc_socket_t *sock, bool yes) {
        REQUIRE(VALID_SOCKET(sock));
        INSIST(!sock->dupped);
 
-#ifdef IPV6_V6ONLY
+#if defined(IPV6_V6ONLY) && !defined(__OpenBSD__)
        if (sock->pf == AF_INET6) {
                if (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_V6ONLY,
                               (void *)&onoff, sizeof(int)) < 0)