diff options
| author | Anton Tolchanov <anton@tailscale.com> | 2025-09-08 15:30:24 +0100 |
|---|---|---|
| committer | Anton Tolchanov <anton@tailscale.com> | 2025-09-08 15:30:24 +0100 |
| commit | 12ee752d963c94ea18c1a28bccf82695acbd9b6c (patch) | |
| tree | 0cb429bedf57e0bd5314e5636c1c581b93a7f98c /ipn/ipnlocal | |
| parent | 275345f498a3ca949c79042fdc73874e27feb43e (diff) | |
| download | tailscale-knyar/netmapdiff2.tar.xz tailscale-knyar/netmapdiff2.zip | |
getting confused by cmp.diffknyar/netmapdiff2
Diffstat (limited to 'ipn/ipnlocal')
| -rw-r--r-- | ipn/ipnlocal/c2n.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ipn/ipnlocal/c2n.go b/ipn/ipnlocal/c2n.go index a1076e5e5..c0a30ffd4 100644 --- a/ipn/ipnlocal/c2n.go +++ b/ipn/ipnlocal/c2n.go @@ -20,6 +20,7 @@ import ( "strings" "time" + "github.com/google/go-cmp/cmp" "tailscale.com/clientupdate" "tailscale.com/control/controlclient" "tailscale.com/envknob" @@ -162,7 +163,8 @@ func handleC2NDebugNetMap(b *LocalBackend, w http.ResponseWriter, r *http.Reques b.logf("c2n: %s /debug/netmap received", r.Method) - cur, err := json.Marshal(b.NetMapWithPeers()) + curNetmap := b.NetMapWithPeers() + cur, err := json.Marshal(curNetmap) if err != nil { http.Error(w, fmt.Sprintf("failed to marshal current netmap: %v", err), http.StatusInternalServerError) return @@ -190,6 +192,13 @@ func handleC2NDebugNetMap(b *LocalBackend, w http.ResponseWriter, r *http.Reques return } resp.Candidate = candJSON + + n1 := curNetmap.SelfNode.AsStruct() + n2 := curNetmap.SelfNode.AsStruct() + n2.Cap = 15 + if diff := cmp.Diff(n1, n2); diff != "" { + b.logf("c2n: candidate netmap differs from current netmap:\n%s", diff) + } } } writeJSON(w, resp) |
