[PATCH 4/5] Store sockaddr listen port in net-byte-order as is conventional

2023-08-17 Thread Daniel Gröber
This will allow more codesharing with code dealing with the peer endpoints. Signed-off-by: Daniel Gröber --- src/config.c | 2 -- src/ipc-freebsd.h | 2 +- src/ipc-linux.h | 6 +++--- src/ipc-openbsd.h | 4 ++-- src/ipc-uapi.h| 2 +- src/ipc-windows.h | 4 ++-- src/show.c

[PATCH 5/5] Replace print_endpoint with print_sockaddr_inet

2023-08-17 Thread Daniel Gröber
Note this changes the commandline behaviour slightly. Previously we would output the gai_strerror message instead of the address when getnameinfo fails. I don't think this behaviour is very useful for scripts as it's hard to match for since we're missing, say, an "error: " prefix. Instead print th

[PATCH 3/5] Support binding sockets to address and netdev for multihomed hosts

2023-08-17 Thread Daniel Gröber
Signed-off-by: Daniel Gröber --- src/config.c | 116 +++--- src/containers.h | 33 +++-- src/ipc-freebsd.h | 4 ++ src/ipc-linux.h | 38 ++- src/ipc-openbsd.h | 4 ++ src/ipc-uapi.h| 2 + src/ipc-windows.h | 4 ++ s

[PATCH 2/5] uapi/linux: Add definitions for address/netdev bound listen sockets

2023-08-17 Thread Daniel Gröber
Signed-off-by: Daniel Gröber --- src/uapi/linux/linux/wireguard.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/uapi/linux/linux/wireguard.h b/src/uapi/linux/linux/wireguard.h index 0efd52c..36afb66 100644 --- a/src/uapi/linux/linux/wireguard.h +++ b/src/uapi/linux/linux/wireguard

[PATCH 1/5] wg: Support restricting address family of DNS resolved Endpoint

2023-08-17 Thread Daniel Gröber
When using wireguard tunnels for providing IPv6 connectivity to machines it can be important to pin which IP address family should be used. Consider a peer using a DNS name with both A/ records, wg will currently blindly follow system policy and use the first address returned by getaddrinfo().

[PATCH] wireguard: Add netlink attrs for binding to address and netdev

2023-08-17 Thread Daniel Gröber
Multihomed hosts may want to run distinct wg tunnels across all their uplinks for redundant connectivity. Currently this entails picking different ports for each wg tunnel since we allow only binding to the wildcard address. Sharing a single port-number for all uplink connections (but bound to a pa

[PATCH] wireguard: Fix leaking sockets in wg_socket_init error paths

2023-08-17 Thread Daniel Gröber
--- drivers/net/wireguard/socket.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireguard/socket.c b/drivers/net/wireguard/socket.c index 0414d7a6ce74..c35163f503e7 100644 --- a/drivers/net/wireguard/socket.c +++ b/drivers/net/wireguard/socket.c @@ -387,

[syzbot] [wireguard?] INFO: rcu detected stall in wg_ratelimiter_gc_entries (2)

2023-08-17 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:ace0ab3a4b54 Revert "vlan: Fix VLAN 0 memory leak" git tree: net console output: https://syzkaller.appspot.com/x/log.txt?x=16153769a8 kernel config: https://syzkaller.appspot.com/x/.config?x=3e670757e16affb dashboard link: htt