mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-26 03:41:37 +00:00
Use CKR in router when sending packets
This commit is contained in:
parent
295e9c9a10
commit
87b0f5fe24
@ -133,9 +133,18 @@ func (r *router) sendPacket(bs []byte) {
|
|||||||
copy(dest[:], bs[24:])
|
copy(dest[:], bs[24:])
|
||||||
var snet subnet
|
var snet subnet
|
||||||
copy(snet[:], bs[24:])
|
copy(snet[:], bs[24:])
|
||||||
|
if !dest.isValid() && !snet.isValid() {
|
||||||
|
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() {
|
if !dest.isValid() && !snet.isValid() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
doSearch := func(packet []byte) {
|
doSearch := func(packet []byte) {
|
||||||
var nodeID, mask *NodeID
|
var nodeID, mask *NodeID
|
||||||
if dest.isValid() {
|
if dest.isValid() {
|
||||||
|
Loading…
Reference in New Issue
Block a user