mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-09 13:24:05 +00:00
have listener return a net.Conn, adjust yggdrasil.Conn to match this interface
This commit is contained in:
@ -93,7 +93,7 @@ func (s *tunConn) _read(bs []byte) (err error) {
|
||||
skip = true
|
||||
} else if key, err := s.tun.ckr.getPublicKeyForAddress(srcAddr, addrlen); err == nil {
|
||||
srcNodeID := crypto.GetNodeID(&key)
|
||||
if s.conn.RemoteAddr() == *srcNodeID {
|
||||
if *s.conn.RemoteAddr().(*crypto.NodeID) == *srcNodeID {
|
||||
// This is the one allowed CKR case, where source and destination addresses are both good
|
||||
} else {
|
||||
// The CKR key associated with this address doesn't match the sender's NodeID
|
||||
@ -170,7 +170,7 @@ func (s *tunConn) _write(bs []byte) (err error) {
|
||||
skip = true
|
||||
} else if key, err := s.tun.ckr.getPublicKeyForAddress(dstAddr, addrlen); err == nil {
|
||||
dstNodeID := crypto.GetNodeID(&key)
|
||||
if s.conn.RemoteAddr() == *dstNodeID {
|
||||
if *s.conn.RemoteAddr().(*crypto.NodeID) == *dstNodeID {
|
||||
// This is the one allowed CKR case, where source and destination addresses are both good
|
||||
} else {
|
||||
// The CKR key associated with this address doesn't match the sender's NodeID
|
||||
|
Reference in New Issue
Block a user