ipc: windows: support incremental allowed ips updates

Following the Linux case, now support the same API on Windows.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2026-03-24 03:22:51 +01:00
parent 997ffa0c89
commit 06a99cce2c
2 changed files with 9 additions and 8 deletions

View file

@ -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;

View file

@ -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