aboutsummaryrefslogtreecommitdiffstats
path: root/wintun.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-07-04 21:06:17 +0000
committerJason A. Donenfeld <Jason@zx2c4.com>2019-07-05 06:15:46 +0000
commit74371554461a5f8cc42e4828d6123febc88c1dec (patch)
tree5f983d40f854164c5e27aefb7f54c5e5455193db /wintun.c
parentDo not use _RESOURCES but rather allocate our own copy (diff)
downloadwintun-74371554461a5f8cc42e4828d6123febc88c1dec.tar.xz
wintun-74371554461a5f8cc42e4828d6123febc88c1dec.zip
Decrease alignment requirements to 4
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'wintun.c')
-rw-r--r--wintun.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wintun.c b/wintun.c
index 3ff9e8c..9ba1b1f 100644
--- a/wintun.c
+++ b/wintun.c
@@ -32,7 +32,7 @@
#define TUN_EXCH_MAX_PACKETS 256
/* Maximum exchange packet size - empirically determined by net buffer list (pool) limitations */
#define TUN_EXCH_MAX_PACKET_SIZE 0xF000
-#define TUN_EXCH_ALIGNMENT 16 /* Memory alignment in exchange buffers */
+#define TUN_EXCH_ALIGNMENT sizeof(ULONG) /* Memory alignment in exchange buffers */
/* Maximum IP packet size (headers + payload) */
#define TUN_EXCH_MAX_IP_PACKET_SIZE (TUN_EXCH_MAX_PACKET_SIZE - sizeof(TUN_PACKET))
/* Maximum size of read/write exchange buffer */
@@ -60,7 +60,8 @@
typedef struct _TUN_PACKET
{
ULONG Size; /* Size of packet data (TUN_EXCH_MAX_IP_PACKET_SIZE max) */
- _Field_size_bytes_(Size) __declspec(align(TUN_EXCH_ALIGNMENT)) UCHAR Data[]; /* Packet data */
+ _Field_size_bytes_(Size)
+ UCHAR Data[]; /* Packet data */
} TUN_PACKET;
typedef enum _TUN_FLAGS