diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-04-22 19:15:20 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-04-22 19:15:20 +0000 |
commit | 935d16472d8127aa61a9f26885d070c361bb1523 (patch) | |
tree | 81ae99ffec7074f2b1b00f5720759c71a318431c | |
parent | 2a5f091dc309c562c765dc1dc859a4fea1bdef1e (diff) | |
download | FreeBSD-src-935d16472d8127aa61a9f26885d070c361bb1523.zip FreeBSD-src-935d16472d8127aa61a9f26885d070c361bb1523.tar.gz |
Assert the inpcb lock when rehashing an inpcb.
Improve consistency of style around some current assertions.
MFC after: 3 months
-rw-r--r-- | sys/netinet/in_pcb.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 26602cc..9dac3ec 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1003,6 +1003,7 @@ in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr, u_short fport = fport_arg, lport = lport_arg; INP_INFO_RLOCK_ASSERT(pcbinfo); + /* * First look for an exact match. */ @@ -1078,6 +1079,8 @@ in_pcbinshash(struct inpcb *inp) u_int32_t hashkey_faddr; INP_INFO_WLOCK_ASSERT(pcbinfo); + INP_LOCK_ASSERT(inp); + #ifdef INET6 if (inp->inp_vflag & INP_IPV6) hashkey_faddr = inp->in6p_faddr.s6_addr32[3] /* XXX */; @@ -1131,6 +1134,7 @@ in_pcbrehash(struct inpcb *inp) INP_INFO_WLOCK_ASSERT(pcbinfo); INP_LOCK_ASSERT(inp); + #ifdef INET6 if (inp->inp_vflag & INP_IPV6) hashkey_faddr = inp->in6p_faddr.s6_addr32[3] /* XXX */; @@ -1183,6 +1187,7 @@ in_pcbsosetlabel(struct socket *so) inp = sotoinpcb(so); KASSERT(inp != NULL, ("in_pcbsosetlabel: so->so_pcb == NULL")); + INP_LOCK(inp); SOCK_LOCK(so); mac_inpcb_sosetlabel(so, inp); |