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
This commit is contained in:
Robert Watson 2005-06-01 12:14:56 +00:00
parent e6e0b5ffd1
commit 303939942c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146866

View file

@ -1211,6 +1211,8 @@ tcp_attach(so)
int nofd = so->so_state & SS_NOFDREF; /* XXX */ int nofd = so->so_state & SS_NOFDREF; /* XXX */
so->so_state &= ~SS_NOFDREF; /* don't free the socket yet */ so->so_state &= ~SS_NOFDREF; /* don't free the socket yet */
INP_LOCK(inp);
#ifdef INET6 #ifdef INET6
if (isipv6) if (isipv6)
in6_pcbdetach(inp); in6_pcbdetach(inp);