mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-05 08:00:30 +00:00
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:
parent
e6e0b5ffd1
commit
303939942c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146866
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue