diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-08-11 04:35:20 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-08-11 04:35:20 +0000 |
commit | 4bd194b32a1ba975b98d4ef876eb0c3c2a9f98ea (patch) | |
tree | 9f9539712ecb6f35da753f8eba245aadf8d01a6f /sys | |
parent | a3fba644404cdf23b516738878b4813300347454 (diff) | |
download | FreeBSD-src-4bd194b32a1ba975b98d4ef876eb0c3c2a9f98ea.zip FreeBSD-src-4bd194b32a1ba975b98d4ef876eb0c3c2a9f98ea.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/in_pcb.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 4e5dbee..bd09eb1 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -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)) |