tun: windows: Make writing persistent too

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2019-03-22 12:44:14 +01:00
parent 9748a52073
commit a80db5e65e

View File

@ -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))