net/sockstats: return early if no radio period length

Signed-off-by: Will Norris <will@tailscale.com>
main
Will Norris 3 years ago committed by Will Norris
parent 75784e10e2
commit 22680a11ae
  1. 3
      net/sockstats/sockstats_tsgo.go

@ -332,6 +332,9 @@ func (rm *radioMonitor) radioHighPercent() int64 {
now := rm.now().Unix()
var periodLength int64 = radioSampleSize
if t := now - rm.startTime; t < periodLength {
if t <= 0 {
return 0
}
periodLength = t
}
periodStart := now - periodLength // start of current reporting period

Loading…
Cancel
Save