From 36ab8094dd0913f2e3abfec8f68c8eb8a59b9932 Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 1 Jun 2005 12:06:07 +0000 Subject: 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 --- sys/netinet/tcp_timewait.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/netinet/tcp_timewait.c') 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); -- cgit v1.1