From 07bd5e1d17e5b017f520531c75b7f538d8fb08c8 Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 1 Jun 2005 12:03:18 +0000 Subject: Assert that tcbinfo is locked in tcp_input() before calling into tcp_drop(). MFC after: 7 days --- sys/netinet/tcp_input.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys/netinet/tcp_input.c') diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 7392610..dcc79cb 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1054,6 +1054,9 @@ after_listen: inet_ntoa(inp->inp_inc.inc_faddr), inp->inp_inc.inc_fport, tp->rcv_byps / tp->rcv_pps); + KASSERT(headlocked, ("tcp_input: " + "after_listen: tcp_drop: head " + "not locked")); tp = tcp_drop(tp, ECONNRESET); tcpstat.tcps_minmssdrops++; goto drop; @@ -1341,8 +1344,11 @@ after_listen: goto dropwithreset; } if (thflags & TH_RST) { - if (thflags & TH_ACK) + if (thflags & TH_ACK) { + KASSERT(headlocked, ("tcp_input: after_listen" + ": tcp_drop.2: head not locked")); tp = tcp_drop(tp, ECONNREFUSED); + } goto drop; } if ((thflags & TH_SYN) == 0) @@ -1738,6 +1744,8 @@ trimthenstep6: * error and we send an RST and drop the connection. */ if (thflags & TH_SYN) { + KASSERT(headlocked, ("tcp_input: tcp_drop: trimthenstep6: " + "head not locked")); tp = tcp_drop(tp, ECONNRESET); rstreason = BANDLIM_UNLIMITED; goto drop; -- cgit v1.1