tun: darwin: do not attempt to close tun.event twice
Previously it was possible for this to race. It turns out we really don't need to set anything to -1 anyway.
This commit is contained in:
parent
a2249449d6
commit
6d78f89557
|
@ -48,10 +48,7 @@ func (tun *NativeTun) routineRouteListener(tunIfindex int) {
|
|||
statusMTU int
|
||||
)
|
||||
|
||||
defer func() {
|
||||
close(tun.events)
|
||||
tun.routeSocket = -1
|
||||
}()
|
||||
defer close(tun.events)
|
||||
|
||||
data := make([]byte, os.Getpagesize())
|
||||
for {
|
||||
|
|
Loading…
Reference in a new issue