mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-26 13:01:39 +00:00
make tun stop check that iface is not nil, in case it wasn't set for some reason (windows bugs)
This commit is contained in:
parent
d08c2eb237
commit
c53831696b
@ -189,9 +189,11 @@ func (tun *TunAdapter) Stop() error {
|
|||||||
|
|
||||||
func (tun *TunAdapter) _stop() error {
|
func (tun *TunAdapter) _stop() error {
|
||||||
tun.isOpen = false
|
tun.isOpen = false
|
||||||
// TODO: we have nothing that cleanly stops all the various goroutines opened
|
|
||||||
// by TUN/TAP, e.g. readers/writers, sessions
|
// by TUN/TAP, e.g. readers/writers, sessions
|
||||||
tun.iface.Close()
|
if tun.iface != nil {
|
||||||
|
// Just in case we failed to start up the iface for some reason, this can apparently happen on Windows
|
||||||
|
tun.iface.Close()
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user