When querying a local or remote address on an IPv6 socket, use only a
read lock on the inpcb. MFC after: 3 months
This commit is contained in:
parent
baa45840d7
commit
8328afb791
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=178320
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user