mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-07 01:04:07 +00:00
add a newConn function that returns a pointer to a Conn with atomics properly initialized
This commit is contained in:
@ -412,9 +412,9 @@ func (tun *TunAdapter) ifaceReader() error {
|
||||
// Dial to the remote node
|
||||
if c, err := tun.dialer.DialByNodeIDandMask(dstNodeID, dstNodeIDMask); err == nil {
|
||||
// We've been given a connection so start the connection reader goroutine
|
||||
go tun.connReader(&c)
|
||||
go tun.connReader(c)
|
||||
// Then update our reference to the connection
|
||||
conn, isIn = &c, true
|
||||
conn, isIn = c, true
|
||||
} else {
|
||||
// We weren't able to dial for some reason so there's no point in
|
||||
// continuing this iteration - skip to the next one
|
||||
|
Reference in New Issue
Block a user