summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-04-03 12:43:56 +0000
committerrwatson <rwatson@FreeBSD.org>2006-04-03 12:43:56 +0000
commit206bd5674e4c71f5b56cf5b999c549dfebe5d319 (patch)
tree06454947a4464dbfb3575e3c78a6d574620037da /sys/netinet
parent57fde1acd9d06b3d72ff9aa21a26cf226e28e72f (diff)
downloadFreeBSD-src-206bd5674e4c71f5b56cf5b999c549dfebe5d319.zip
FreeBSD-src-206bd5674e4c71f5b56cf5b999c549dfebe5d319.tar.gz
Clarify comment on handling of non-timewait TCP states in
tcp_usr_detach(). MFC after: 3 months
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_usrreq.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index b0ed728..547dfe6 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -218,14 +218,16 @@ tcp_usr_detach(struct socket *so)
INP_UNLOCK(inp);
}
} else {
+ /*
+ * If not in timewait, there are two possible paths. First,
+ * the TCP connection is either embryonic or done, in which
+ * case we tear down all state. Second, it may still be
+ * active, in which case we acquire a reference to the socket
+ * and will free it later when TCP is done.
+ */
tp = intotcpcb(inp);
if (inp->inp_vflag & INP_DROPPED ||
tp->t_state < TCPS_SYN_SENT) {
- /*
- * Connection has been dropped or is a listen socket,
- * tear down all pcb state and allow socket to be
- * freed.
- */
tcp_discardcb(tp);
#ifdef INET6
if (isipv6) {
OpenPOWER on IntegriCloud