Fix TCP incoming sequence number check.

This commit is contained in:
whitequark 2016-12-26 17:24:37 +00:00
parent 2d562c10fa
commit 79553e81d4
1 changed files with 2 additions and 3 deletions

View File

@ -399,9 +399,8 @@ impl<'a> TcpSocket<'a> {
(State::SynSent, _) => (),
// In all other states, segments must occupy a valid portion of the receive window.
// For now, do not try to reassemble out-of-order segments.
(_, TcpRepr { control, seq_number, .. }) => {
let next_remote_seq = self.remote_seq_no + self.rx_buffer.len() as i32 +
control.len();
(_, TcpRepr { seq_number, .. }) => {
let next_remote_seq = self.remote_seq_no + self.rx_buffer.len() as i32;
if seq_number - next_remote_seq > 0 {
net_trace!("tcp:{}:{}: unacceptable SEQ ({} not in {}..)",
self.local_endpoint, self.remote_endpoint,