]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
tun_windows: Stop checking minimum size of received TUN packets
authorSimon Rozman <simon@rozman.si>
Wed, 6 Feb 2019 19:22:04 +0000 (20:22 +0100)
committerSimon Rozman <simon@rozman.si>
Wed, 6 Feb 2019 19:22:04 +0000 (20:22 +0100)
Signed-off-by: Simon Rozman <simon@rozman.si>
tun/tun_windows.go

index a9b29d2dcb1ed5922843537bbae898ff27918765..0e6415530b02cf4ea74ecc4fbd913c1282f7569e 100644 (file)
@@ -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
                                }