can't just drop on close w/o now default linger 'cuz RST is generated
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Tue, 21 Jun 1983 13:43:59 +0000 (05:43 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Tue, 21 Jun 1983 13:43:59 +0000 (05:43 -0800)
SCCS-vsn: sys/netinet/tcp_usrreq.c 1.80

usr/src/sys/netinet/tcp_usrreq.c

index 1bba19a..9a50528 100644 (file)
@@ -1,4 +1,4 @@
-/*     tcp_usrreq.c    1.79    83/06/14        */
+/*     tcp_usrreq.c    1.80    83/06/20        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -327,7 +327,7 @@ bad:
 /*
  * Initiate (or continue) disconnect.
  * If embryonic state, just send reset (once).
 /*
  * Initiate (or continue) disconnect.
  * If embryonic state, just send reset (once).
- * If not in ``let data drain'' option, just drop.
+ * If in ``let data drain'' option and linger null, just drop.
  * Otherwise (hard), mark socket disconnecting and drop
  * current input data; switch states based on user close, and
  * send segment to peer (with FIN).
  * Otherwise (hard), mark socket disconnecting and drop
  * current input data; switch states based on user close, and
  * send segment to peer (with FIN).
@@ -340,7 +340,7 @@ tcp_disconnect(tp)
 
        if (tp->t_state < TCPS_ESTABLISHED)
                tp = tcp_close(tp);
 
        if (tp->t_state < TCPS_ESTABLISHED)
                tp = tcp_close(tp);
-       else if (so->so_linger == 0)
+       else if ((so->so_options & SO_LINGER) && so->so_linger == 0)
                tp = tcp_drop(tp, 0);
        else {
                soisdisconnecting(so);
                tp = tcp_drop(tp, 0);
        else {
                soisdisconnecting(so);