From: Kyle Evans Date: Sat, 12 Apr 2025 02:46:03 +0000 (-0500) Subject: ipc: freebsd: use AF_LOCAL for the control socket X-Git-Tag: v1.0.20250521~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=13d190bc72ce1753fbf0d1d6828677d1bc743807;p=thirdparty%2Fwireguard-tools.git 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 --- 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; }