From be7065f7f541f3eb1dcb64869ef1fed716645cd1 Mon Sep 17 00:00:00 2001 From: zacoons Date: Tue, 28 Apr 2026 08:51:18 +1000 Subject: [PATCH] std.Io: fix openSocketPosix ignoring ip6_only option --- lib/std/Io/Kqueue.zig | 2 +- lib/std/Io/Threaded.zig | 2 +- lib/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 index 30c2cd8070b3a7ea70311424bfd959a1722e8858..8d673525560c1898b7c1976979c0079feaebe676 100644 --- 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 index 5a76e773fa7f0ce04d13a91eda0e654d0f0aaa10..69995da839eb7b5ca79ce5f6070d88a231b1e319 100644 --- 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 index accbf942963559c2a882fffa1639fe6895ff1f3a..3112a9b4633e4e0ae4a851b5f58cf8badec1a2a6 100644 --- 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; -- 2.54.0