Author: tuexen
Date: Thu Nov 17 08:15:02 2016
New Revision: 308745
URL: https://svnweb.freebsd.org/changeset/base/308745

Log:
  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

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_stacks/fastpath.c

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c        Thu Nov 17 07:33:37 2016        
(r308744)
+++ head/sys/netinet/tcp_input.c        Thu Nov 17 08:15:02 2016        
(r308745)
@@ -2202,6 +2202,8 @@ tcp_do_segment(struct mbuf *m, struct tc
                                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);

Modified: head/sys/netinet/tcp_stacks/fastpath.c
==============================================================================
--- head/sys/netinet/tcp_stacks/fastpath.c      Thu Nov 17 07:33:37 2016        
(r308744)
+++ head/sys/netinet/tcp_stacks/fastpath.c      Thu Nov 17 08:15:02 2016        
(r308745)
@@ -746,6 +746,8 @@ tcp_do_slowpath(struct mbuf *m, struct t
                                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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to