aboutsummaryrefslogtreecommitdiffstats
path: root/wintun.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-12-10 14:38:41 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-12-10 14:39:06 +0100
commit5f681022c9e6c670568b882d36f971c84d8e84d8 (patch)
tree1804bf9a12d174cfdd4d146eb427210f62148e31 /wintun.c
parentIncrement discarded packets properly (diff)
downloadwintun-5f681022c9e6c670568b882d36f971c84d8e84d8.tar.xz
wintun-5f681022c9e6c670568b882d36f971c84d8e84d8.zip
Invert skipPacket condition so code matches
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 e2dd828..624de2f 100644
--- a/wintun.c
+++ b/wintun.c
@@ -242,8 +242,9 @@ TunSendNetBufferLists(
{
PacketsCount++;
UINT PacketSize = NET_BUFFER_DATA_LENGTH(Nb);
- if (PacketSize <= TUN_MAX_IP_PACKET_SIZE)
- RequiredRingSpace += TUN_ALIGN(sizeof(TUN_PACKET) + PacketSize);
+ if (PacketSize > TUN_MAX_IP_PACKET_SIZE)
+ continue; /* The same condition holds down below, where we `goto skipPacket`. */
+ RequiredRingSpace += TUN_ALIGN(sizeof(TUN_PACKET) + PacketSize);
}
}