summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-10-19 23:34:50 +0000
committergVisor bot <gvisor-bot@google.com>2021-10-19 23:34:50 +0000
commit83d15c722c37a76bc7259f4ba1a6134218f710ca (patch)
tree9284c116b5bf0689d0469d108f6b4fca4ea049a6 /pkg/tcpip
parentc9f4765892ba729604a15f34187648d3a1ce9bb2 (diff)
parent64aee33ed0e1a422c3e2954de8f1d3f219ed14b8 (diff)
Merge release-20211011.0-33-g64aee33ed (automated)
Diffstat (limited to 'pkg/tcpip')
-rw-r--r--pkg/tcpip/stack/conntrack.go7
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()
}