mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2026-05-22 05:46:30 +03:00
Fix bug in mask generation for outbound dials, change iface reader mutexes to read-only locks unless RW is needed
This commit is contained in:
@@ -35,7 +35,7 @@ func (d *Dialer) Dial(network, address string) (Conn, error) {
|
||||
return Conn{}, err
|
||||
}
|
||||
copy(nodeID[:], dest)
|
||||
for idx := 0; idx <= len; idx++ {
|
||||
for idx := 0; idx < len; idx++ {
|
||||
nodeMask[idx/8] |= 0x80 >> byte(idx%8)
|
||||
}
|
||||
} else {
|
||||
@@ -65,8 +65,8 @@ func (d *Dialer) DialByNodeIDandMask(nodeID, nodeMask *crypto.NodeID) (Conn, err
|
||||
nodeMask: nodeMask,
|
||||
recv: make(chan *wire_trafficPacket, 32),
|
||||
}
|
||||
conn.core.router.doAdmin(func() {
|
||||
conn.core.router.admin <- func() {
|
||||
conn.startSearch()
|
||||
})
|
||||
}
|
||||
return conn, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user