diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2008-04-19 14:36:19 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2008-04-19 14:36:19 +0000 |
commit | 8328afb7911c6261913c78faeb0e604baf8e7877 (patch) | |
tree | f6cdef8110d43ca6e6134d90b10dbc1fe3cff72b /sys/netinet6/in6_pcb.c | |
parent | baa45840d7c8424215ff4ed3468f30067dee37ce (diff) | |
download | src-8328afb7911c6261913c78faeb0e604baf8e7877.tar.gz src-8328afb7911c6261913c78faeb0e604baf8e7877.zip |
When querying a local or remote address on an IPv6 socket, use only a
read lock on the inpcb.
MFC after: 3 months
Notes
Notes:
svn path=/head/; revision=178320
Diffstat (limited to 'sys/netinet6/in6_pcb.c')
-rw-r--r-- | sys/netinet6/in6_pcb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 9986e69e40fc..b62c6af13376 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -489,10 +489,10 @@ in6_getsockaddr(struct socket *so, struct sockaddr **nam) inp = sotoinpcb(so); KASSERT(inp != NULL, ("in6_getsockaddr: inp == NULL")); - INP_WLOCK(inp); + INP_RLOCK(inp); port = inp->inp_lport; addr = inp->in6p_laddr; - INP_WUNLOCK(inp); + INP_RUNLOCK(inp); *nam = in6_sockaddr(port, &addr); return 0; @@ -508,10 +508,10 @@ in6_getpeeraddr(struct socket *so, struct sockaddr **nam) inp = sotoinpcb(so); KASSERT(inp != NULL, ("in6_getpeeraddr: inp == NULL")); - INP_WLOCK(inp); + INP_RLOCK(inp); port = inp->inp_fport; addr = inp->in6p_faddr; - INP_WUNLOCK(inp); + INP_RUNLOCK(inp); *nam = in6_sockaddr(port, &addr); return 0; |