5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-12-22 23:25:39 +00:00

replace panics with warning messages if the tun reader/writer return an error

This commit is contained in:
Arceliar 2018-12-16 17:23:07 -06:00
parent d9f212dd39
commit db034ce6bd

View File

@ -56,8 +56,8 @@ func (tun *tunAdapter) start(ifname string, iftapmode bool, addr string, mtu int
tun.mutex.Lock()
tun.isOpen = true
tun.mutex.Unlock()
go func() { panic(tun.read()) }()
go func() { panic(tun.write()) }()
go func() { tun.core.log.Println("WARNING: tun.read() exited with error:", tun.read()) }()
go func() { tun.core.log.Println("WARNING: tun.write() exited with error:", tun.write()) }()
if iftapmode {
go func() {
for {