Page MenuHomeFreeBSD

D12267.diff
No OneTemporary

D12267.diff

Index: head/sys/netinet/tcp_timewait.c
===================================================================
--- head/sys/netinet/tcp_timewait.c
+++ head/sys/netinet/tcp_timewait.c
@@ -709,10 +709,29 @@
INP_WLOCK(inp);
tw = intotw(inp);
if (in_pcbrele_wlocked(inp)) {
- KASSERT(tw == NULL, ("%s: held last inp "
- "reference but tw not NULL", __func__));
- INP_INFO_RUNLOCK(&V_tcbinfo);
- continue;
+ if (__predict_true(tw == NULL)) {
+ INP_INFO_RUNLOCK(&V_tcbinfo);
+ continue;
+ } else {
+ /* This should not happen as in TIMEWAIT
+ * state the inp should not be destroyed
+ * before its tcptw. If INVARIANTS is
+ * defined panic.
+ */
+#ifdef INVARIANTS
+ panic("%s: Panic before an infinite "
+ "loop: INP_TIMEWAIT && (INP_FREED "
+ "|| inp last reference) && tw != "
+ "NULL", __func__);
+#else
+ log(LOG_ERR, "%s: Avoid an infinite "
+ "loop: INP_TIMEWAIT && (INP_FREED "
+ "|| inp last reference) && tw != "
+ "NULL", __func__);
+#endif
+ INP_INFO_RUNLOCK(&V_tcbinfo);
+ break;
+ }
}
if (tw == NULL) {

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 15, 7:57 AM (18 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9091567
Default Alt Text
D12267.diff (1 KB)

Event Timeline