Skip to content

Commit

Permalink
ipn/ipnlocal: log errors while fetching serial numbers
Browse files Browse the repository at this point in the history
If the client cannot fetch a serial number, write a log message helping
the user understand what happened. Also, don't just return the error
immediately, since we still have a chance to collect network interface
addresses.

Updates tailscale#5902

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
  • Loading branch information
knyar committed Oct 29, 2024
1 parent 0d76d7d commit 94fa6d9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ipn/ipnlocal/c2n.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,10 @@ func handleC2NPostureIdentityGet(b *LocalBackend, w http.ResponseWriter, r *http
}

if choice.ShouldEnable(b.Prefs().PostureChecking()) {
sns, err := posture.GetSerialNumbers(b.logf)
res.SerialNumbers, err = posture.GetSerialNumbers(b.logf)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
b.logf("c2n: GetSerialNumbers returned error: %v", err)
}
res.SerialNumbers = sns

// TODO(tailscale/corp#21371, 2024-07-10): once this has landed in a stable release
// and looks good in client metrics, remove this parameter and always report MAC
Expand Down

0 comments on commit 94fa6d9

Please sign in to comment.