Page MenuHomeFreeBSD

D35730.id107830.diff
No OneTemporary

D35730.id107830.diff

diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -828,8 +828,8 @@
#endif
inp = sotoinpcb(so);
+ INP_WLOCK_ASSERT(inp);
inp->inp_inc.inc_fibnum = so->so_fibnum;
- INP_WLOCK(inp);
/*
* Exclusive pcbinfo lock is not required in syncache socket case even
* if two inpcb locks can be acquired simultaneously:
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
@@ -202,7 +202,13 @@
goto out;
}
tp->t_state = TCPS_CLOSED;
- INP_WUNLOCK(inp);
+ /*
+ * Unlock the inp when being called from so_create(), but do not
+ * when being called from sonewconn().
+ * sonewconn() expects the inp to be locked.
+ */
+ if (so->so_listen == NULL)
+ INP_WUNLOCK(inp);
TCPSTATES_INC(TCPS_CLOSED);
out:
TCPDEBUG2(PRU_ATTACH);

File Metadata

Mime Type
text/plain
Expires
Mon, Feb 9, 4:26 AM (9 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28536825
Default Alt Text
D35730.id107830.diff (900 B)

Event Timeline