From 46279ad0f9561fb98c562c2c9dcc3f431357b26b Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 6 Feb 2019 20:22:04 +0100 Subject: tun_windows: Stop checking minimum size of received TUN packets Signed-off-by: Simon Rozman --- tun/tun_windows.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 } -- cgit v1.2.3-54-g00ecf