aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2006-04-25 12:09:58 +0000
committerRobert Watson <rwatson@FreeBSD.org>2006-04-25 12:09:58 +0000
commit8deea4a8f3e24373706aa85e9f09c19acd8e9454 (patch)
tree011200dff73d659a24e0ad1366f3cbf766fe9876 /sys
parent102ea03373d20f59d1933a3c06e255575c8e8b8b (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/in6_pcb.c10
-rw-r--r--sys/netinet6/in6_src.c3
2 files changed, 10 insertions, 3 deletions
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index 16b48103476e..e83d04314302 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -297,6 +297,9 @@ in6_pcbladdr(inp, nam, plocal_addr6)
struct ifnet *ifp = NULL;
int scope_ambiguous = 0;
+ INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
+ INP_LOCK_ASSERT(inp);
+
if (nam->sa_len != sizeof (*sin6))
return (EINVAL);
if (sin6->sin6_family != AF_INET6)
@@ -309,9 +312,6 @@ in6_pcbladdr(inp, nam, plocal_addr6)
if ((error = sa6_embedscope(sin6, ip6_use_defzone)) != 0)
return(error);
- INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
- INP_LOCK_ASSERT(inp);
-
if (in6_ifaddr) {
/*
* If the destination address is UNSPECIFIED addr,
@@ -723,6 +723,8 @@ in6_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
int matchwild = 3, wildcard;
u_short lport = lport_arg;
+ INP_INFO_WLOCK_ASSERT(pcbinfo);
+
if (!wild_okay) {
struct inpcbhead *head;
/*
@@ -888,6 +890,8 @@ in6_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard, ifp)
u_short fport = fport_arg, lport = lport_arg;
int faith;
+ INP_INFO_RLOCK_ASSERT(pcbinfo);
+
if (faithprefix_p != NULL)
faith = (*faithprefix_p)(laddr);
else
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index 61cf9db51ec8..bedb3a4cb88f 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -760,6 +760,9 @@ in6_pcbsetport(laddr, inp, cred)
int count, error = 0, wild = 0;
struct inpcbinfo *pcbinfo = inp->inp_pcbinfo;
+ INP_INFO_WLOCK_ASSERT(pcbinfo);
+ INP_LOCK_ASSERT(inp);
+
/* XXX: this is redundant when called from in6_pcbbind */
if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0)
wild = INPLOOKUP_WILDCARD;