Skip to contentSkip to conversation

tcp: Reset tcp connections in SYN-SENT state

PATCH Eric Dumazet 1 participant 1 message Feb 21, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 19 lines · Devi Sandeep Endluri V V

Userspace sends tcp connection (sock) destroy on network permission change. Kernel though doesn't send reset for the connections in SYN-SENT state and these connections continue to remain. Even as per RFC 793, there is no hard rule to not send RST on ABORT in this state. Change to make sure RST are send for connections in syn-sent state to avoid lingering connections on network switch.

References from RFC 793

ABORT Call

SYN-SENT STATE

All queued SENDs and RECEIVEs should be given "connection reset" notification, delete the TCB, enter CLOSED state, and return.

SEGMENT ARRIVES

Quoted 7 lines

If the state is SYN-SENT then
If the RST bit is set

If the ACK was acceptable then signal the user "error:
connection reset", drop the segment, enter CLOSED state, delete TCB, and return. Otherwise (no ACK) drop the segment and return.

This patch and commit log is quite misleading.

It appears all you want to change is the stack behavior on the tcp_abort() case (ss -K ..) for SYN_SENT sockets.

This patch _does_ not change the behavior for sockets that are closed by the usual way (close(fd)) while on SYN_SENT state.

It would be really nice if you said so in the change log, instead of citing an old RFC.

Otherwise I have to spend time deciphering the whole thing.

Thank you.