diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-10-19 23:34:50 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-19 23:34:50 +0000 |
commit | 83d15c722c37a76bc7259f4ba1a6134218f710ca (patch) | |
tree | 9284c116b5bf0689d0469d108f6b4fca4ea049a6 /pkg/tcpip | |
parent | c9f4765892ba729604a15f34187648d3a1ce9bb2 (diff) | |
parent | 64aee33ed0e1a422c3e2954de8f1d3f219ed14b8 (diff) |
Merge release-20211011.0-33-g64aee33ed (automated)
Diffstat (limited to 'pkg/tcpip')
-rw-r--r-- | pkg/tcpip/stack/conntrack.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/conntrack.go b/pkg/tcpip/stack/conntrack.go index 89f8ef09f..a3f403855 100644 --- a/pkg/tcpip/stack/conntrack.go +++ b/pkg/tcpip/stack/conntrack.go @@ -562,11 +562,16 @@ func (ct *ConnTrack) reapUnused(start int, prevInterval time.Duration) (int, tim idx = (i + start) % len(ct.buckets) bkt := &ct.buckets[idx] bkt.mu.Lock() - for tuple := bkt.tuples.Front(); tuple != nil; tuple = tuple.Next() { + for tuple := bkt.tuples.Front(); tuple != nil; { + // reapTupleLocked updates tuple's next pointer so we grab it here. + nextTuple := tuple.Next() + checked++ if ct.reapTupleLocked(tuple, idx, bkt, now) { expired++ } + + tuple = nextTuple } bkt.mu.Unlock() } |