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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
// Get TUN data pipe.
|
// Get TUN data pipe.
|
||||||
_, file, err := tun.getTUN()
|
_, file, err := tun.getTUN()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -297,12 +298,13 @@ func (tun *NativeTun) Flush() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if tun.shouldReopenHandle(err) {
|
if tun.shouldReopenHandle(err) {
|
||||||
tun.closeTUN()
|
tun.closeTUN()
|
||||||
return nil
|
continue
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (tun *NativeTun) putTunPacket(buff []byte) error {
|
func (tun *NativeTun) putTunPacket(buff []byte) error {
|
||||||
size := uint32(len(buff))
|
size := uint32(len(buff))
|
||||||
|
|
Loading…
Reference in a new issue