mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-12-24 16:57:53 +00:00
Merge pull request #205 from Arceliar/tunfix
fix crash when starting in tun mode
This commit is contained in:
commit
3b8cd0a8d6
@ -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…
x
Reference in New Issue
Block a user