ipn/{ipnlocal,localapi}: add debug verb to force spam IPN bus NetMap
To force the problem in its worst case scenario before fixing it. Updates tailscale/corp#17859 Change-Id: I2c8b8e5f15c7801e1ab093feeafac52ec175a763 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
04fceae898
commit
ad33e47270
|
@ -2367,6 +2367,20 @@ func (b *LocalBackend) DebugNotify(n ipn.Notify) {
|
||||||
b.send(n)
|
b.send(n)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DebugNotifyLastNetMap injects a fake notify message to clients,
|
||||||
|
// repeating whatever the last netmap was.
|
||||||
|
//
|
||||||
|
// It should only be used via the LocalAPI's debug handler.
|
||||||
|
func (b *LocalBackend) DebugNotifyLastNetMap() {
|
||||||
|
b.mu.Lock()
|
||||||
|
nm := b.netMap
|
||||||
|
b.mu.Unlock()
|
||||||
|
|
||||||
|
if nm != nil {
|
||||||
|
b.send(ipn.Notify{NetMap: nm})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// DebugForceNetmapUpdate forces a full no-op netmap update of the current
|
// DebugForceNetmapUpdate forces a full no-op netmap update of the current
|
||||||
// netmap in all the various subsystems (wireguard, magicsock, LocalBackend).
|
// netmap in all the various subsystems (wireguard, magicsock, LocalBackend).
|
||||||
//
|
//
|
||||||
|
|
|
@ -599,6 +599,8 @@ func (h *Handler) serveDebug(w http.ResponseWriter, r *http.Request) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
h.b.DebugNotify(n)
|
h.b.DebugNotify(n)
|
||||||
|
case "notify-last-netmap":
|
||||||
|
h.b.DebugNotifyLastNetMap()
|
||||||
case "break-tcp-conns":
|
case "break-tcp-conns":
|
||||||
err = h.b.DebugBreakTCPConns()
|
err = h.b.DebugBreakTCPConns()
|
||||||
case "break-derp-conns":
|
case "break-derp-conns":
|
||||||
|
|
Loading…
Reference in New Issue