wgengine/magicsock: add nodeid to panic condition on public key reuse

If the condition arises, it should be easy to track down.

Updates #9547
Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
James Tucker 2023-09-27 13:32:08 -07:00 committed by James Tucker
parent 2066f9fbb2
commit 80206b5323

View File

@ -1893,7 +1893,7 @@ func (c *Conn) SetNetworkMap(nm *netmap.NetworkMap) {
// that differs from the one the NodeID had. But double check.
if ep.nodeID != n.ID() {
// Server error.
devPanicf("public key moved between nodeIDs")
devPanicf("public key moved between nodeIDs (old=%v new=%v, key=%s)", ep.nodeID, n.ID(), n.Key().String())
} else {
// Internal data structures out of sync.
devPanicf("public key found in peerMap but not by nodeID")