diff options
author | rwatson <rwatson@FreeBSD.org> | 2008-04-19 14:36:19 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2008-04-19 14:36:19 +0000 |
commit | e93ab31cf5c2291715911f30e134559825197d92 (patch) | |
tree | f6cdef8110d43ca6e6134d90b10dbc1fe3cff72b /sys/netinet6 | |
parent | 9b7e6d648c8456fdf28f9911f04f62702a215320 (diff) | |
download | FreeBSD-src-e93ab31cf5c2291715911f30e134559825197d92.zip FreeBSD-src-e93ab31cf5c2291715911f30e134559825197d92.tar.gz |
When querying a local or remote address on an IPv6 socket, use only a
read lock on the inpcb.
MFC after: 3 months
Diffstat (limited to 'sys/netinet6')
-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 9986e69..b62c6af 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; |