summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-11-13 05:16:56 +0000
committersam <sam@FreeBSD.org>2003-11-13 05:16:56 +0000
commit135a94b34b4288a6f5ff890b035519c060fa1a1c (patch)
tree8c81d56f50d956896a21fbe4fffd92b52120cf8e /sys/netinet/in_pcb.c
parent5b063056ef8df203c8644511c37b7357c648261a (diff)
downloadFreeBSD-src-135a94b34b4288a6f5ff890b035519c060fa1a1c.zip
FreeBSD-src-135a94b34b4288a6f5ff890b035519c060fa1a1c.tar.gz
o reorder some locking asserts to reflect the order of the locks
o correct a read-lock assert in in_pcblookup_local that should be a write-lock assert (since time wait close cleanups may alter state) Supported by: FreeBSD Foundation
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index eda8053..48fed21 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -208,9 +208,9 @@ in_pcbbind(inp, nam, td)
{
int anonport, error;
+ INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
INP_LOCK_ASSERT(inp);
- INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
if (inp->inp_lport != 0 || inp->inp_laddr.s_addr != INADDR_ANY)
return (EINVAL);
anonport = inp->inp_lport == 0 && (nam == NULL ||
@@ -255,9 +255,9 @@ in_pcbbind_setup(inp, nam, laddrp, lportp, td)
int wild = 0, reuseport = (so->so_options & SO_REUSEPORT);
int error, prison = 0;
+ INP_INFO_WLOCK_ASSERT(pcbinfo);
INP_LOCK_ASSERT(inp);
- INP_INFO_WLOCK_ASSERT(pcbinfo);
if (TAILQ_EMPTY(&in_ifaddrhead)) /* XXX broken! */
return (EADDRNOTAVAIL);
laddr.s_addr = *laddrp;
@@ -939,7 +939,8 @@ in_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
int matchwild = 3, wildcard;
u_short lport = lport_arg;
- INP_INFO_RLOCK_ASSERT(pcbinfo);
+ INP_INFO_WLOCK_ASSERT(pcbinfo);
+
if (!wild_okay) {
struct inpcbhead *head;
/*
OpenPOWER on IntegriCloud