summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-06-01 12:03:18 +0000
committerrwatson <rwatson@FreeBSD.org>2005-06-01 12:03:18 +0000
commit07bd5e1d17e5b017f520531c75b7f538d8fb08c8 (patch)
treed69278f3674a790fb9e913f9afae4572f122ac2a /sys/netinet/tcp_input.c
parentfe0bf623ad311f3aee6c729f327285b3baa24e34 (diff)
downloadFreeBSD-src-07bd5e1d17e5b017f520531c75b7f538d8fb08c8.zip
FreeBSD-src-07bd5e1d17e5b017f520531c75b7f538d8fb08c8.tar.gz
Assert that tcbinfo is locked in tcp_input() before calling into
tcp_drop(). MFC after: 7 days
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c10
1 files changed, 9 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud