aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2026-09-19 16:34:13 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2026-09-20 13:54:54 +0200
commit447360b078d82ebbd8a63fd9da68a400a5df42bf (patch)
tree90de543dffa0523e0f3ba0d2fab001c674373406
parentui: update the blocking state when Table is off (diff)
downloadwireguard-windows-447360b078d82ebbd8a63fd9da68a400a5df42bf.tar.xz
wireguard-windows-447360b078d82ebbd8a63fd9da68a400a5df42bf.zip
embeddable-dll-service: csharp: fix allowed IP layout
The CIDR byte follows the 16-byte address and two-byte address family, placing it at offset 18. Add the missing flags field at offset 20 and its Remove flag to match the native structure. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--embeddable-dll-service/csharp/TunnelDll/Driver.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/embeddable-dll-service/csharp/TunnelDll/Driver.cs b/embeddable-dll-service/csharp/TunnelDll/Driver.cs
index 231802a1..fdaba0e2 100644
--- a/embeddable-dll-service/csharp/TunnelDll/Driver.cs
+++ b/embeddable-dll-service/csharp/TunnelDll/Driver.cs
@@ -215,6 +215,11 @@ namespace Tunnel
public UInt32 AllowedIPsCount;
};
+ private enum IoctlAllowedIPFlags : UInt32
+ {
+ Remove = 1 << 0
+ };
+
[StructLayout(LayoutKind.Explicit, Pack = 8, Size = 24)]
private unsafe struct IoctlAllowedIP
{
@@ -226,8 +231,10 @@ namespace Tunnel
public Win32.IN6_ADDR V6;
[FieldOffset(16)]
public Win32.ADDRESS_FAMILY AddressFamily;
- [FieldOffset(20)]
+ [FieldOffset(18)]
public byte Cidr;
+ [FieldOffset(20)]
+ public IoctlAllowedIPFlags Flags;
}
}
}