Simple lie test (#427)

This commit is contained in:
Nathan Brown
2021-03-31 10:26:35 -05:00
committed by GitHub
parent 830d6d4639
commit 0c2e5973e1
16 changed files with 650 additions and 121 deletions

View File

@ -164,12 +164,11 @@ func (c *Control) CloseAllTunnels(excludeLighthouses bool) (closed int) {
}
func copyHostInfo(h *HostInfo) ControlHostInfo {
addrs := h.RemoteUDPAddrs()
chi := ControlHostInfo{
VpnIP: int2ip(h.hostId),
LocalIndex: h.localIndexId,
RemoteIndex: h.remoteIndexId,
RemoteAddrs: make([]*udpAddr, len(addrs), len(addrs)),
RemoteAddrs: h.CopyRemotes(),
CachedPackets: len(h.packetStore),
MessageCounter: atomic.LoadUint64(&h.ConnectionState.atomicMessageCounter),
}
@ -182,9 +181,5 @@ func copyHostInfo(h *HostInfo) ControlHostInfo {
chi.CurrentRemote = h.remote.Copy()
}
for i, addr := range addrs {
chi.RemoteAddrs[i] = addr.Copy()
}
return chi
}