Summary: | wireguard: wg(8) fails on INET6-only kernel | ||
---|---|---|---|
Product: | Base System | Reporter: | Lexi Winter <lexi.freebsd> |
Component: | kern | Assignee: | Kyle Evans <kevans> |
Status: | In Progress --- | ||
Severity: | Affects Only Me | CC: | crest, kevans, net |
Priority: | --- | ||
Version: | 15.0-CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
Lexi Winter
2024-06-19 05:22:20 UTC
How does this feel? diff --git a/contrib/wireguard-tools/ipc-freebsd.h b/contrib/wireguard-tools/ipc-freebsd.h index fa74edda5a3d..446f13cacac2 100644 --- a/contrib/wireguard-tools/ipc-freebsd.h +++ b/contrib/wireguard-tools/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; } From running `truss wg` on a system with IPv4 support in the kernel and a single unconfigured WireGuard interface it looks like the socket is used at least for the SIOCGIFGMEMB and SIOCGWG: ioctl(3,SIOCGIFGMEMB,0x1...) = 0 (0x0) ioctl(3,SIOCGIFGMEMB,0x1...) = 0 (0x0) ioctl(3,SIOCGWG,0x1...) = 0 (0x0) ioctl(3,SIOCGWG,0x1...) = 0 (0x0) Are those ioctl()s available on AF_UNIX and AF_INET6 sockets or only on AF_INET sockets? (In reply to crest from comment #2) There's a patch in comment #1 that you're welcome to test. |