Update tuntap module, return pointers

This commit is contained in:
Neil Alexander 2020-02-16 23:21:58 +00:00
parent c107f891d2
commit 63936c11b5
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
3 changed files with 5 additions and 4 deletions

View file

@ -251,7 +251,8 @@ func (tun *TunAdapter) _wrap(conn *yggdrasil.Conn) (c *tunConn, err error) {
}
c = &s
// Get the remote address and subnet of the other side
remoteNodeID := conn.RemoteAddr().(*crypto.NodeID)
remotePubKey := conn.RemoteAddr().(*crypto.BoxPubKey)
remoteNodeID := crypto.GetNodeID(remotePubKey)
s.addr = *address.AddrForNodeID(remoteNodeID)
s.snet = *address.SubnetForNodeID(remoteNodeID)
// Work out if this is already a destination we already know about