Don't reply to a TCP RST packet with another TCP RST packet.

This commit is contained in:
Egor Karavaev 2017-06-25 19:08:32 +03:00 committed by whitequark
parent 1e8cd1a65f
commit 4f2804e104
1 changed files with 4 additions and 0 deletions

View File

@ -297,6 +297,10 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
// The packet wasn't handled by a socket, send a TCP RST packet.
let tcp_packet = TcpPacket::new_checked(ip_payload)?;
if tcp_packet.rst() {
// Don't reply to a TCP RST packet with another TCP RST packet.
return Ok(Response::Nop)
}
let tcp_reply_repr = TcpRepr {
src_port: tcp_packet.dst_port(),
dst_port: tcp_packet.src_port(),