mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
add a newConn function that returns a pointer to a Conn with atomics properly initialized
This commit is contained in:
parent
75130f7735
commit
0059baf36c
4 changed files with 30 additions and 28 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue