5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-12-26 11:15:41 +00:00

Use CKR in router when sending packets

This commit is contained in:
Neil Alexander 2018-11-05 22:39:30 +00:00
parent 295e9c9a10
commit 87b0f5fe24
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -134,7 +134,16 @@ func (r *router) sendPacket(bs []byte) {
var snet subnet
copy(snet[:], bs[24:])
if !dest.isValid() && !snet.isValid() {
return
if key, err := r.cryptokey.getPublicKeyForAddress(dest); err == nil {
addr := *address_addrForNodeID(getNodeID(&key))
copy(dest[:], addr[:])
copy(snet[:], addr[:])
if !dest.isValid() && !snet.isValid() {
return
}
} else {
return
}
}
doSearch := func(packet []byte) {
var nodeID, mask *NodeID