mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-02-14 19:01:52 +00:00
Use CKR in router when sending packets
This commit is contained in:
parent
295e9c9a10
commit
87b0f5fe24
1 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue