Assert the locks of inpcbinfo's and inpcb's passed into in_pcbconnect()
and in_pcbconnect_setup(), since these functions frob the port and address state of inpcbs.
This commit is contained in:
parent
8ab79fb0e1
commit
27f74fd0ed
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=133469
@ -461,6 +461,9 @@ in_pcbconnect(inp, nam, cred)
|
||||
in_addr_t laddr, faddr;
|
||||
int anonport, error;
|
||||
|
||||
INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
|
||||
INP_LOCK_ASSERT(inp);
|
||||
|
||||
lport = inp->inp_lport;
|
||||
laddr = inp->inp_laddr.s_addr;
|
||||
anonport = (lport == 0);
|
||||
@ -530,6 +533,9 @@ in_pcbconnect_setup(inp, nam, laddrp, lportp, faddrp, fportp, oinpp, cred)
|
||||
u_short lport, fport;
|
||||
int error;
|
||||
|
||||
INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
|
||||
INP_LOCK_ASSERT(inp);
|
||||
|
||||
if (oinpp != NULL)
|
||||
*oinpp = NULL;
|
||||
if (nam->sa_len != sizeof (*sin))
|
||||
|
Loading…
Reference in New Issue
Block a user