From 4bd194b32a1ba975b98d4ef876eb0c3c2a9f98ea Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 11 Aug 2004 04:35:20 +0000 Subject: 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. --- sys/netinet/in_pcb.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/netinet/in_pcb.c') 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)) -- cgit v1.1