diff options
author | Eyal Soha <eyalsoha@google.com> | 2020-04-19 22:14:53 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-19 22:16:14 -0700 |
commit | db2a60be67f0e869a58eb12d253a0d7fe13ebfa3 (patch) | |
tree | abd1a0ad3a7c84f301e5bad7f8ae83db8e9c03e3 /pkg/tcpip/seqnum | |
parent | 08b2fd9bc2a963ea15821b782cf6d80c15dbdf42 (diff) |
Don't accept segments outside the receive window
Fixed to match RFC 793 page 69.
Fixes #1607
PiperOrigin-RevId: 307334892
Diffstat (limited to 'pkg/tcpip/seqnum')
-rw-r--r-- | pkg/tcpip/seqnum/seqnum.go | 5 |
1 files changed, 0 insertions, 5 deletions
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) |