Merge pull request #205 from Arceliar/tunfix

fix crash when starting in tun mode
This commit is contained in:
Arceliar 2018-11-10 22:44:02 -06:00 committed by GitHub
commit 3b8cd0a8d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.read()) }()
go func() { panic(tun.write()) }() go func() { panic(tun.write()) }()
if iftapmode {
go func() { go func() {
for { for {
if _, ok := tun.icmpv6.peermacs[tun.core.router.addr]; ok { 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) time.Sleep(time.Second)
} }
}() }()
}
return nil return nil
} }