]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
ipc: windows: support incremental allowed ips updates
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 24 Mar 2026 02:22:51 +0000 (03:22 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 24 Mar 2026 02:22:51 +0000 (03:22 +0100)
Following the Linux case, now support the same API on Windows.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/ipc-windows.h
src/uapi/windows/wireguard.h

index 137151aec1e09c378a0c876647efc753932db89a..207b8004f8c3c364d99cccc719dc4d337f8027d3 100644 (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;
 
index 5c5938e1d6b424e73b06ad037cb0a80897e9b662..8859efbbe18fc6221e45399dd88c74966843cbc0 100644 (file)
 
 #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