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
|
statusMTU int
|
||||||
)
|
)
|
||||||
|
|
||||||
defer func() {
|
defer close(tun.events)
|
||||||
close(tun.events)
|
|
||||||
tun.routeSocket = -1
|
|
||||||
}()
|
|
||||||
|
|
||||||
data := make([]byte, os.Getpagesize())
|
data := make([]byte, os.Getpagesize())
|
||||||
for {
|
for {
|
||||||
|
Loading…
Reference in New Issue
Block a user