From db2a60be67f0e869a58eb12d253a0d7fe13ebfa3 Mon Sep 17 00:00:00 2001 From: Eyal Soha Date: Sun, 19 Apr 2020 22:14:53 -0700 Subject: Don't accept segments outside the receive window Fixed to match RFC 793 page 69. Fixes #1607 PiperOrigin-RevId: 307334892 --- pkg/tcpip/seqnum/seqnum.go | 5 ----- 1 file changed, 5 deletions(-) (limited to 'pkg/tcpip/seqnum') diff --git a/pkg/tcpip/seqnum/seqnum.go b/pkg/tcpip/seqnum/seqnum.go index b40a3c212..d3bea7de4 100644 --- a/pkg/tcpip/seqnum/seqnum.go +++ b/pkg/tcpip/seqnum/seqnum.go @@ -46,11 +46,6 @@ func (v Value) InWindow(first Value, size Size) bool { return v.InRange(first, first.Add(size)) } -// Overlap checks if the window [a,a+b) overlaps with the window [x, x+y). -func Overlap(a Value, b Size, x Value, y Size) bool { - return a.LessThan(x.Add(y)) && x.LessThan(a.Add(b)) -} - // Add calculates the sequence number following the [v, v+s) window. func (v Value) Add(s Size) Value { return v + Value(s) -- cgit v1.2.3