From 13d190bc72ce1753fbf0d1d6828677d1bc743807 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Fri, 11 Apr 2025 21:46:03 -0500 Subject: [PATCH] ipc: freebsd: use AF_LOCAL for the control socket AF_INET assumes that IPv4 is built into the kernel, but it's completely valid to build a kernel without it. unix(4) sockets, on the other hand, are not-optional in the kernel build. Given that interface ioctls can be invoked on any kind of socket, switch to the safer one to avoid breaking on IPv6-only kernels. Signed-off-by: Kyle Evans Signed-off-by: Jason A. Donenfeld --- src/ipc-freebsd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipc-freebsd.h b/src/ipc-freebsd.h index fa74edd..446f13c 100644 --- a/src/ipc-freebsd.h +++ b/src/ipc-freebsd.h @@ -15,7 +15,7 @@ static int get_dgram_socket(void) { static int sock = -1; if (sock < 0) - sock = socket(AF_INET, SOCK_DGRAM, 0); + sock = socket(AF_LOCAL, SOCK_DGRAM, 0); return sock; } -- 2.47.3