let user close after fin acked
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Sat, 20 Feb 1982 02:29:37 +0000 (18:29 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Sat, 20 Feb 1982 02:29:37 +0000 (18:29 -0800)
SCCS-vsn: sys/netinet/tcp_usrreq.c 1.50

usr/src/sys/netinet/tcp_usrreq.c

index 7983ae0..d37e921 100644 (file)
@@ -1,4 +1,4 @@
-/* tcp_usrreq.c 1.49 82/01/18 */
+/* tcp_usrreq.c 1.50 82/02/19 */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -322,6 +322,7 @@ tcp_disconnect(tp)
  * state.  In all other cases, have already sent FIN to peer (e.g.
  * after PRU_SHUTDOWN), and just have to play tedious game waiting
  * for peer to send FIN or not respond to keep-alives, etc.
  * state.  In all other cases, have already sent FIN to peer (e.g.
  * after PRU_SHUTDOWN), and just have to play tedious game waiting
  * for peer to send FIN or not respond to keep-alives, etc.
+ * We can let the user exit from the close as soon as the FIN is acked.
  */
 tcp_usrclosed(tp)
        struct tcpcb *tp;
  */
 tcp_usrclosed(tp)
        struct tcpcb *tp;
@@ -344,4 +345,6 @@ tcp_usrclosed(tp)
                tp->t_state = TCPS_LAST_ACK;
                break;
        }
                tp->t_state = TCPS_LAST_ACK;
                break;
        }
+       if (tp->t_state >= TCPS_FIN_WAIT_2)
+               soisdisconnected(tp->t_inpcb->inp_socket);
 }
 }