]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
ipc: freebsd: use AF_LOCAL for the control socket
authorKyle Evans <kevans@FreeBSD.org>
Sat, 12 Apr 2025 02:46:03 +0000 (21:46 -0500)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 20 May 2025 19:59:23 +0000 (21:59 +0200)
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 <kevans@FreeBSD.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/ipc-freebsd.h

index fa74edda5a3d4392e29de4c50289fa6c798b6ab1..446f13cacac265d96a7176d1de479e7f1a0b12ff 100644 (file)
@@ -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;
 }