aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2005-06-01 12:14:56 +0000
committerRobert Watson <rwatson@FreeBSD.org>2005-06-01 12:14:56 +0000
commit303939942c22338c4661a56dd0fae27a6aaccde6 (patch)
treeab5c40260b87470b09489db9aea8dc9b59778c3d /sys/netinet/tcp_usrreq.c
parente6e0b5ffd1a7421ee73600b2b1de61efd56feaa9 (diff)
downloadsrc-303939942c22338c4661a56dd0fae27a6aaccde6.tar.gz
src-303939942c22338c4661a56dd0fae27a6aaccde6.zip
When aborting tcp_attach() due to a problem allocating or attaching the
tcpcb, lock the inpcb before calling in_pcbdetach() or in6_pcbdetach(), as they expect the inpcb to be passed locked. MFC after: 7 days
Notes
Notes: svn path=/head/; revision=146866
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index ccdc807a8a0c..653ab6c3ffc7 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1211,6 +1211,8 @@ tcp_attach(so)
int nofd = so->so_state & SS_NOFDREF; /* XXX */
so->so_state &= ~SS_NOFDREF; /* don't free the socket yet */
+
+ INP_LOCK(inp);
#ifdef INET6
if (isipv6)
in6_pcbdetach(inp);