From 590e4296306cd92e21dc888a6233b8f4608bf8c5 Mon Sep 17 00:00:00 2001 From: Voxis Date: Mon, 16 Feb 2026 15:53:35 +0100 Subject: [PATCH] fix(discovery): add SO_REUSEPORT for multiple mDNS listeners --- capsule-core/src/discovery.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/capsule-core/src/discovery.zig b/capsule-core/src/discovery.zig index 419d4dc..e1939a1 100644 --- a/capsule-core/src/discovery.zig +++ b/capsule-core/src/discovery.zig @@ -30,6 +30,7 @@ pub const DiscoveryService = struct { // 2. Allow port reuse (standard for mDNS) try posix.setsockopt(fd, posix.SOL.SOCKET, posix.SO.REUSEADDR, &std.mem.toBytes(@as(i32, 1))); + try posix.setsockopt(fd, posix.SOL.SOCKET, posix.SO.REUSEPORT, &std.mem.toBytes(@as(i32, 1))); // 3. Bind to all interfaces on mDNS port const bind_addr = try net.Address.parseIp("0.0.0.0", MULTICAST_PORT);