Notify the use via setting errno when a TCP RST segment is received

either in the CLOSING or LAST-ACK state.

Reviewed by:		hiren
MFC after:		3 weeks
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D8371
This commit is contained in:
Michael Tuexen 2016-11-17 08:15:02 +00:00
parent c702a80e27
commit 6779a1a101
2 changed files with 4 additions and 0 deletions

View File

@ -2202,6 +2202,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
case TCPS_FIN_WAIT_1:
case TCPS_FIN_WAIT_2:
case TCPS_CLOSE_WAIT:
case TCPS_CLOSING:
case TCPS_LAST_ACK:
so->so_error = ECONNRESET;
close:
tcp_state_change(tp, TCPS_CLOSED);

View File

@ -746,6 +746,8 @@ tcp_do_slowpath(struct mbuf *m, struct tcphdr *th, struct socket *so,
case TCPS_FIN_WAIT_1:
case TCPS_FIN_WAIT_2:
case TCPS_CLOSE_WAIT:
case TCPS_CLOSING:
case TCPS_LAST_ACK:
so->so_error = ECONNRESET;
close:
tcp_state_change(tp, TCPS_CLOSED);