summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index e3fcdf1..8064f2b 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1624,6 +1624,8 @@ tcp_twstart(tp)
int tw_time, acknow;
struct socket *so;
+ INP_LOCK_ASSERT(tp->t_inpcb);
+
tw = uma_zalloc(tcptw_zone, M_NOWAIT);
if (tw == NULL) {
tw = tcp_timer_2msl_tw(1);
@@ -1694,6 +1696,10 @@ tcp_twstart(tp)
* Determine if the ISN we will generate has advanced beyond the last
* sequence number used by the previous connection. If so, indicate
* that it is safe to recycle this tw socket by returning 1.
+ *
+ * XXXRW: This function should assert the inpcb lock as it does multiple
+ * non-atomic reads from the tcptw, but is currently * called without it from
+ * in_pcb.c:in_pcblookup_local().
*/
int
tcp_twrecycleable(struct tcptw *tw)
@@ -1716,6 +1722,8 @@ tcp_twclose(struct tcptw *tw, int reuse)
struct inpcb *inp;
inp = tw->tw_inpcb;
+ INP_LOCK_ASSERT(inp);
+
tw->tw_inpcb = NULL;
tcp_timer_2msl_stop(tw);
inp->inp_ppcb = NULL;
@@ -1749,6 +1757,8 @@ tcp_twrespond(struct tcptw *tw, int flags)
int isipv6 = inp->inp_inc.inc_isipv6;
#endif
+ INP_LOCK_ASSERT(inp);
+
m = m_gethdr(M_DONTWAIT, MT_HEADER);
if (m == NULL)
return (ENOBUFS);
OpenPOWER on IntegriCloud