zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit be7065f7f541f3eb1dcb64869ef1fed716645cd1 (tree)
parent d0c6ed189b334fa4ad60485724d59ad9a78b0046
Author: zacoons <zac@zacoons.com>
Date:   Tue, 28 Apr 2026 08:51:18 +1000

std.Io: fix openSocketPosix ignoring ip6_only option

Diffstat:
Mlib/std/Io/Kqueue.zig | 2+-
Mlib/std/Io/Threaded.zig | 2+-
Mlib/std/Io/Uring.zig | 2+-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/std/Io/Kqueue.zig b/lib/std/Io/Kqueue.zig @@ -1403,7 +1403,7 @@ fn openSocketPosix( if (options.ip6_only) { if (posix.IPV6 == void) return error.OptionUnsupported; - try setSocketOption(k, socket_fd, posix.IPPROTO.IPV6, posix.IPV6.V6ONLY, 0); + try setSocketOption(k, socket_fd, posix.IPPROTO.IPV6, posix.IPV6.V6ONLY, 1); } return socket_fd; diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig @@ -12409,7 +12409,7 @@ fn openSocketPosix( if (options.ip6_only) { if (posix.IPV6 == void) return error.OptionUnsupported; - try setSocketOptionPosix(socket_fd, posix.IPPROTO.IPV6, posix.IPV6.V6ONLY, 0); + try setSocketOptionPosix(socket_fd, posix.IPPROTO.IPV6, posix.IPV6.V6ONLY, 1); } return socket_fd; diff --git a/lib/std/Io/Uring.zig b/lib/std/Io/Uring.zig @@ -5984,7 +5984,7 @@ fn socket( if (options.ip6_only) { if (linux.IPV6 == void) return error.OptionUnsupported; - try ev.setsockopt(cancel_region, socket_fd, linux.IPPROTO.IPV6, linux.IPV6.V6ONLY, 0); + try ev.setsockopt(cancel_region, socket_fd, linux.IPPROTO.IPV6, linux.IPV6.V6ONLY, 1); } return socket_fd;