wgengine/magicsock: call peerMap.validate at the end of SetNetworkMap

Not for prod, maybe useful for debugging.
This commit is contained in:
Josh Bleecher Snyder 2021-11-10 14:05:38 -08:00
parent 2bef8ecece
commit aec281e638

View File

@ -2264,6 +2264,11 @@ func nodesEqual(x, y []*tailcfg.Node) bool {
func (c *Conn) SetNetworkMap(nm *netmap.NetworkMap) {
c.mu.Lock()
defer c.mu.Unlock()
defer func() {
if err := c.peerMap.validate(); err != nil {
panic(err)
}
}()
if c.closed {
return