diff options
author | Simon Rozman <simon@rozman.si> | 2019-06-05 11:55:28 +0200 |
---|---|---|
committer | Simon Rozman <simon@rozman.si> | 2019-06-05 11:55:28 +0200 |
commit | e4b0ef29a16479a0d7f44968e9e0a2d5603a5783 (patch) | |
tree | 7c48f8b4acde05fc9d5f030c91d423cd11e401d2 /tun | |
parent | 625e445b22afbb4dab20eed07640388ea36b332d (diff) |
tun: windows: obsolete 256 packets per exchange buffer limitation
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'tun')
-rw-r--r-- | tun/tun_windows.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go index 583ff6b..8c384f6 100644 --- a/tun/tun_windows.go +++ b/tun/tun_windows.go @@ -19,7 +19,6 @@ import ( ) const ( - packetExchangeMax uint32 = 256 // Number of packets that may be written at a time packetExchangeAlignment uint32 = 16 // Number of bytes packets are aligned to in exchange buffers packetSizeMax uint32 = 0xf000 - packetExchangeAlignment // Maximum packet size packetExchangeSize uint32 = 0x100000 // Exchange buffer size (defaults to 1MiB) @@ -339,7 +338,7 @@ func (tun *NativeTun) putTunPacket(buff []byte) error { } pSize := packetAlign(packetExchangeAlignment + size) - if tun.wrBuff.packetNum >= packetExchangeMax || tun.wrBuff.offset+pSize >= packetExchangeSize { + if tun.wrBuff.offset+pSize >= packetExchangeSize { // Exchange buffer is full -> flush first. err := tun.Flush() if err != nil { |