tcp: allow sending ACKs in FinWait2 state.

This commit is contained in:
Dario Nieuwenhuis 2020-12-18 16:26:41 +01:00 committed by whitequark
parent de5f91a28b
commit 42dc04852b
1 changed files with 8 additions and 2 deletions

View File

@ -1574,8 +1574,9 @@ impl<'a> TcpSocket<'a> {
} }
} }
// We do not transmit anything in the FIN-WAIT-2 state. // We do not transmit data in the FIN-WAIT-2 state, but we may transmit
State::FinWait2 => return Err(Error::Exhausted), // ACKs for incoming data.
State::FinWait2 => {}
// We do not transmit data or control flags in the CLOSING or TIME-WAIT states, // We do not transmit data or control flags in the CLOSING or TIME-WAIT states,
// but we may retransmit an ACK. // but we may retransmit an ACK.
@ -3093,6 +3094,11 @@ mod test {
assert_eq!(data, b"abc"); assert_eq!(data, b"abc");
(3, ()) (3, ())
}).unwrap(); }).unwrap();
recv!(s, [TcpRepr {
seq_number: LOCAL_SEQ + 1 + 1,
ack_number: Some(REMOTE_SEQ + 1 + 3),
..RECV_TEMPL
}]);
} }
#[test] #[test]