give yggdrasil.Dialer the same interface as a net.Dialer, so the only differences are what fields exist in the struct

This commit is contained in:
Arceliar 2019-10-21 19:44:06 -05:00
parent efc0b9ef9f
commit eccd9a348f
4 changed files with 54 additions and 28 deletions

View file

@ -52,7 +52,7 @@ type TunAdapter struct {
//mutex sync.RWMutex // Protects the below
addrToConn map[address.Address]*tunConn
subnetToConn map[address.Subnet]*tunConn
dials map[crypto.NodeID][][]byte // Buffer of packets to send after dialing finishes
dials map[string][][]byte // Buffer of packets to send after dialing finishes
isOpen bool
}
@ -117,7 +117,7 @@ func (tun *TunAdapter) Init(config *config.NodeState, log *log.Logger, listener
tun.dialer = dialer
tun.addrToConn = make(map[address.Address]*tunConn)
tun.subnetToConn = make(map[address.Subnet]*tunConn)
tun.dials = make(map[crypto.NodeID][][]byte)
tun.dials = make(map[string][][]byte)
tun.writer.tun = tun
tun.reader.tun = tun
}