tun: windows: Make writing persistent too
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
9748a52073
commit
a80db5e65e
@ -284,6 +284,7 @@ func (tun *NativeTun) Flush() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
for {
|
||||
// Get TUN data pipe.
|
||||
_, file, err := tun.getTUN()
|
||||
if err != nil {
|
||||
@ -297,12 +298,13 @@ func (tun *NativeTun) Flush() error {
|
||||
if err != nil {
|
||||
if tun.shouldReopenHandle(err) {
|
||||
tun.closeTUN()
|
||||
return nil
|
||||
continue
|
||||
}
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func (tun *NativeTun) putTunPacket(buff []byte) error {
|
||||
size := uint32(len(buff))
|
||||
|
Loading…
Reference in New Issue
Block a user