summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_timewait.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-06-01 12:06:07 +0000
committerrwatson <rwatson@FreeBSD.org>2005-06-01 12:06:07 +0000
commit36ab8094dd0913f2e3abfec8f68c8eb8a59b9932 (patch)
tree22dd06cf37d3e2b0d6b34c2c9ce4c3c3721e4cef /sys/netinet/tcp_timewait.c
parent07bd5e1d17e5b017f520531c75b7f538d8fb08c8 (diff)
downloadFreeBSD-src-36ab8094dd0913f2e3abfec8f68c8eb8a59b9932.zip
FreeBSD-src-36ab8094dd0913f2e3abfec8f68c8eb8a59b9932.tar.gz
Assert tcbinfo lock in tcp_drop() due to its call of tcp_close()
Assert tcbinfo lock in tcp_close() due to its call to in{,6}_detach() Assert tcbinfo lock in tcp_drop_syn_sent() due to its call to tcp_drop() MFC after: 7 days
Diffstat (limited to 'sys/netinet/tcp_timewait.c')
-rw-r--r--sys/netinet/tcp_timewait.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 4e9038f..3adc16e 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -644,7 +644,9 @@ tcp_drop(tp, errno)
{
struct socket *so = tp->t_inpcb->inp_socket;
+ INP_INFO_WLOCK_ASSERT(&tcbinfo);
INP_LOCK_ASSERT(tp->t_inpcb);
+
if (TCPS_HAVERCVDSYN(tp->t_state)) {
tp->t_state = TCPS_CLOSED;
(void) tcp_output(tp);
@@ -765,6 +767,7 @@ tcp_close(tp)
struct socket *so = inp->inp_socket;
#endif
+ INP_INFO_WLOCK_ASSERT(&tcbinfo);
INP_LOCK_ASSERT(inp);
tcp_discardcb(tp);
@@ -832,6 +835,7 @@ tcp_notify(inp, error)
{
struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb;
+ INP_INFO_WLOCK_ASSERT(&tcbinfo);
INP_LOCK_ASSERT(inp);
/*
@@ -1432,7 +1436,9 @@ tcp_drop_syn_sent(inp, errno)
{
struct tcpcb *tp = intotcpcb(inp);
+ INP_INFO_WLOCK_ASSERT(&tcbinfo);
INP_LOCK_ASSERT(inp);
+
if (tp != NULL && tp->t_state == TCPS_SYN_SENT) {
tcp_drop(tp, errno);
return (NULL);
OpenPOWER on IntegriCloud