mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-25 17:11:37 +00:00
fix crash when starting in tun mode
This commit is contained in:
parent
b3887e554c
commit
1b1b776097
@ -51,6 +51,7 @@ func (tun *tunDevice) start(ifname string, iftapmode bool, addr string, mtu int)
|
||||
}
|
||||
go func() { panic(tun.read()) }()
|
||||
go func() { panic(tun.write()) }()
|
||||
if iftapmode {
|
||||
go func() {
|
||||
for {
|
||||
if _, ok := tun.icmpv6.peermacs[tun.core.router.addr]; ok {
|
||||
@ -66,6 +67,7 @@ func (tun *tunDevice) start(ifname string, iftapmode bool, addr string, mtu int)
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
}()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user