diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-12-10 14:38:41 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-12-10 14:39:06 +0100 |
commit | 5f681022c9e6c670568b882d36f971c84d8e84d8 (patch) | |
tree | 1804bf9a12d174cfdd4d146eb427210f62148e31 /wintun.c | |
parent | Increment discarded packets properly (diff) | |
download | wintun-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); } } |