Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102904765
D36399.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D36399.diff
View Options
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -216,58 +216,13 @@
tp = intotcpcb(inp);
- if (inp->inp_flags & INP_TIMEWAIT) {
- /*
- * There are two cases to handle: one in which the time wait
- * state is being discarded (INP_DROPPED), and one in which
- * this connection will remain in timewait. In the former,
- * it is time to discard all state (except tcptw, which has
- * already been discarded by the timewait close code, which
- * should be further up the call stack somewhere). In the
- * latter case, we detach from the socket, but leave the pcb
- * present until timewait ends.
- *
- * XXXRW: Would it be cleaner to free the tcptw here?
- *
- * Astute question indeed, from twtcp perspective there are
- * four cases to consider:
- *
- * #1 tcp_usr_detach is called at tcptw creation time by
- * tcp_twstart, then do not discard the newly created tcptw
- * and leave inpcb present until timewait ends
- * #2 tcp_usr_detach is called at tcptw creation time by
- * tcp_twstart, but connection is local and tw will be
- * discarded immediately
- * #3 tcp_usr_detach is called at timewait end (or reuse) by
- * tcp_twclose, then the tcptw has already been discarded
- * (or reused) and inpcb is freed here
- * #4 tcp_usr_detach is called() after timewait ends (or reuse)
- * (e.g. by soclose), then tcptw has already been discarded
- * (or reused) and inpcb is freed here
- *
- * In all three cases the tcptw should not be freed here.
- */
- if (inp->inp_flags & INP_DROPPED) {
- KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && "
- "INP_DROPPED && tp != NULL"));
- in_pcbdetach(inp);
- in_pcbfree(inp);
- } else {
- in_pcbdetach(inp);
- INP_WUNLOCK(inp);
- }
- } else {
- /*
- * If the connection is not in timewait, it must be either
- * dropped or embryonic.
- */
- KASSERT(inp->inp_flags & INP_DROPPED ||
- tp->t_state < TCPS_SYN_SENT,
- ("%s: inp %p not dropped or embryonic", __func__, inp));
- tcp_discardcb(tp);
- in_pcbdetach(inp);
- in_pcbfree(inp);
- }
+ KASSERT(inp->inp_flags & INP_DROPPED ||
+ tp->t_state < TCPS_SYN_SENT,
+ ("%s: inp %p not dropped or embryonic", __func__, inp));
+
+ tcp_discardcb(tp);
+ in_pcbdetach(inp);
+ in_pcbfree(inp);
}
#ifdef INET
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 1:44 PM (20 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14717534
Default Alt Text
D36399.diff (2 KB)
Attached To
Mode
D36399: tcp: in tcp_usr_detach() remove special handling of compressed time-wait
Attached
Detach File
Event Timeline
Log In to Comment