HomeFreeBSD

tcp: rate limit the sending of all RST segments

Description

tcp: rate limit the sending of all RST segments

Also rate limit the sending of RST segments in the following cases:

  • when receiving data on a closed socket.
  • when a socket can not be created at the end of the handshake and the sysctl-variable net.inet.tcp.syncache.rst_on_sock_fail is 1.
  • when an ACK segment is received in SYN SENT state and it does not acknowledge the SYN segment.

After this change, there is no need anymore to provide a rstreason
to tcp_dropwithreset(), since it is always BANDLIM_TCP_RST.
This will be a follow-up commit, since it will change the code in a
couple of places, but will not change the functionality.

Reviewed by: rrs, Nick Banks, Peter Lei
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D51815

Details

Provenance
tuexenAuthored on Aug 7 2025, 8:23 PM
Reviewer
rrs
Differential Revision
D51815: tcp: rate limit the sending of all RST segments
Parents
rGb6521ceaf277: tcp : remove assignment without effect
Branches
Unknown
Tags
Unknown