From 0879e5e23f444bd4d8f289a16ddd20a2c5b69f2e Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Fri, 5 Dec 2025 21:18:55 +0100 Subject: [PATCH] nixos/zigbee2mqtt: allow using mDNS for adapters Without this option, the 'mdns://' functionality for zigbee2mqtt does not work at all and fails with the following error message: - SystemError: A system error occurred: uv_interface_addresses returned Unknown system error 97 (Unknown system error 97) Locally I've solved this with an override in my NixOS configuration, and then it seems to work fine. Just using tcp:// addresses was working fine, but using mDNS discovery makes the configuration a bit more flexible. With network changes I don't need to change this anymore. Reading the SystemError, the uv_interfaces_addresses call seems to fail. System error 97 translates to EAFNOSUPPORT, meaning 'Address Family not supported'. This points towards some address family not being supported and/or allowed. libuv seems to be calling getifaddrs, which is likely the reason that an AF_NETLINK socket is required here. See also https://github.com/libuv/libuv/blob/d7dda9edfec189f9087d13f970525188db06464d/src/unix/linux.c#L1967 Concluding; mDNS sockets require interface enumeration, requiring getifaddrs to be called. getifaddrs requires an AF_NETLINK socket. --- nixos/modules/services/home-automation/zigbee2mqtt.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/home-automation/zigbee2mqtt.nix b/nixos/modules/services/home-automation/zigbee2mqtt.nix index d02cc7484991..dbf714bfb84e 100644 --- a/nixos/modules/services/home-automation/zigbee2mqtt.nix +++ b/nixos/modules/services/home-automation/zigbee2mqtt.nix @@ -114,6 +114,7 @@ in RestrictAddressFamilies = [ "AF_INET" "AF_INET6" + "AF_NETLINK" ]; RestrictNamespaces = true; RestrictRealtime = true;