summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/network/internal/fragmentation
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-05-25 20:05:47 +0000
committergVisor bot <gvisor-bot@google.com>2021-05-25 20:05:47 +0000
commit93b3be2eb2457c3c12436503e6da384e40a68944 (patch)
tree1672784315b329b6f64e525456af7653f56eaff0 /pkg/tcpip/network/internal/fragmentation
parent6f34ae308865ce8877797e9b2501a85195c42d7d (diff)
parent4f2439fb0ed4a6efda2637417c7137d27e4c4d26 (diff)
Merge release-20210518.0-38-g4f2439fb0 (automated)
Diffstat (limited to 'pkg/tcpip/network/internal/fragmentation')
-rw-r--r--pkg/tcpip/network/internal/fragmentation/fragmentation.go2
-rw-r--r--pkg/tcpip/network/internal/fragmentation/reassembler.go22
2 files changed, 12 insertions, 12 deletions
diff --git a/pkg/tcpip/network/internal/fragmentation/fragmentation.go b/pkg/tcpip/network/internal/fragmentation/fragmentation.go
index 5168f5361..1ba4d0d36 100644
--- a/pkg/tcpip/network/internal/fragmentation/fragmentation.go
+++ b/pkg/tcpip/network/internal/fragmentation/fragmentation.go
@@ -251,7 +251,7 @@ func (f *Fragmentation) releaseReassemblersLocked() {
// The list is empty.
break
}
- elapsed := time.Duration(now-r.creationTime) * time.Nanosecond
+ elapsed := now.Sub(r.createdAt)
if f.timeout > elapsed {
// If the oldest reassembler has not expired, schedule the release
// job so that this function is called back when it has expired.
diff --git a/pkg/tcpip/network/internal/fragmentation/reassembler.go b/pkg/tcpip/network/internal/fragmentation/reassembler.go
index 56b76a284..5b7e4b361 100644
--- a/pkg/tcpip/network/internal/fragmentation/reassembler.go
+++ b/pkg/tcpip/network/internal/fragmentation/reassembler.go
@@ -35,21 +35,21 @@ type hole struct {
type reassembler struct {
reassemblerEntry
- id FragmentID
- memSize int
- proto uint8
- mu sync.Mutex
- holes []hole
- filled int
- done bool
- creationTime int64
- pkt *stack.PacketBuffer
+ id FragmentID
+ memSize int
+ proto uint8
+ mu sync.Mutex
+ holes []hole
+ filled int
+ done bool
+ createdAt tcpip.MonotonicTime
+ pkt *stack.PacketBuffer
}
func newReassembler(id FragmentID, clock tcpip.Clock) *reassembler {
r := &reassembler{
- id: id,
- creationTime: clock.NowMonotonic(),
+ id: id,
+ createdAt: clock.NowMonotonic(),
}
r.holes = append(r.holes, hole{
first: 0,