From 06a99cce2c9998f53eb30d2f258a9e5ff286445b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 24 Mar 2026 03:22:51 +0100 Subject: [PATCH] ipc: windows: support incremental allowed ips updates Following the Linux case, now support the same API on Windows. Signed-off-by: Jason A. Donenfeld --- src/ipc-windows.h | 7 +------ src/uapi/windows/wireguard.h | 10 ++++++++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ipc-windows.h b/src/ipc-windows.h index 137151a..207b800 100644 --- a/src/ipc-windows.h +++ b/src/ipc-windows.h @@ -417,12 +417,7 @@ static int kernel_set_device(struct wgdevice *dev) aip_count = 0; wg_aip = (void *)wg_peer + sizeof(WG_IOCTL_PEER); for_each_wgallowedip(peer, aip) { - if (aip->flags) { - //TODO: implement me - errno = EOPNOTSUPP; - goto out; - } - + wg_aip->Flags = aip->flags; wg_aip->AddressFamily = aip->family; wg_aip->Cidr = aip->cidr; diff --git a/src/uapi/windows/wireguard.h b/src/uapi/windows/wireguard.h index 5c5938e..8859efb 100644 --- a/src/uapi/windows/wireguard.h +++ b/src/uapi/windows/wireguard.h @@ -14,6 +14,11 @@ #define WG_KEY_LEN 32 +typedef enum +{ + WG_IOCTL_ALLOWED_IP_REMOVE = 1 << 0 +} WG_IOCTL_ALLOWED_IP_FLAG; + typedef struct _WG_IOCTL_ALLOWED_IP { union @@ -21,8 +26,9 @@ typedef struct _WG_IOCTL_ALLOWED_IP IN_ADDR V4; IN6_ADDR V6; } Address; - ADDRESS_FAMILY AddressFamily; - UCHAR Cidr; + ADDRESS_FAMILY AddressFamily; + UCHAR Cidr; + WG_IOCTL_ALLOWED_IP_FLAG Flags; } __attribute__((aligned(8))) WG_IOCTL_ALLOWED_IP; typedef enum