mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-04-13 20:46:55 +02:00
tun: windows: inform wintun of maximum buffer length for writes
This commit is contained in:
parent
c69d026649
commit
5e6eff81b6
1 changed files with 6 additions and 0 deletions
|
@ -141,6 +141,12 @@ func (tun *NativeTun) openTUN() error {
|
|||
}
|
||||
return err
|
||||
}
|
||||
firstSize := (*uint32)(unsafe.Pointer(&tun.wrBuff.data[0]))
|
||||
saved := *firstSize
|
||||
*firstSize = 0
|
||||
// Set the maximum buffer length with an invalid write.
|
||||
tun.tunFileWrite.Write(tun.wrBuff.data[:])
|
||||
*firstSize = saved
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue