diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2006-04-03 12:43:56 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2006-04-03 12:43:56 +0000 |
commit | e6e65783d66040ef1a370bfa238ecd7769cb1212 (patch) | |
tree | 06454947a4464dbfb3575e3c78a6d574620037da /sys/netinet/tcp_usrreq.c | |
parent | fc19db6c7b69c2ae0321880cd1fe8b441edb75ce (diff) | |
download | src-e6e65783d66040ef1a370bfa238ecd7769cb1212.tar.gz src-e6e65783d66040ef1a370bfa238ecd7769cb1212.zip |
Clarify comment on handling of non-timewait TCP states in
tcp_usr_detach().
MFC after: 3 months
Notes
Notes:
svn path=/head/; revision=157429
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index b0ed7285270c..547dfe630aa3 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) { |