From: Simon Rozman Date: Wed, 6 Feb 2019 19:22:04 +0000 (+0100) Subject: tun_windows: Stop checking minimum size of received TUN packets X-Git-Tag: 0.0.20190409~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46279ad0f9561fb98c562c2c9dcc3f431357b26b;p=thirdparty%2Fwireguard-go.git tun_windows: Stop checking minimum size of received TUN packets Signed-off-by: Simon Rozman --- diff --git a/tun/tun_windows.go b/tun/tun_windows.go index a9b29d2..0e64155 100644 --- a/tun/tun_windows.go +++ b/tun/tun_windows.go @@ -15,7 +15,6 @@ import ( ) const ( - TUN_MIN_PACKET_SIZE = 20 TUN_MAX_PACKET_SIZE = 1600 TUN_MAX_PACKET_EXCHANGE = 256 // Number of packets that can be exchanged at a time TUN_EXCHANGE_BUFFER_SIZE = 410632 @@ -176,7 +175,7 @@ func (tun *nativeTun) Read(buff []byte, offset int) (int, error) { tunPacket := &tun.rdBuff.packets[tun.rdNextPacket] tun.rdNextPacket++ - if tunPacket.size < TUN_MIN_PACKET_SIZE || TUN_MAX_PACKET_SIZE < tunPacket.size { + if TUN_MAX_PACKET_SIZE < tunPacket.size { // Invalid packet size. continue }