summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_divert.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2008-10-17 16:26:16 +0000
committerbz <bz@FreeBSD.org>2008-10-17 16:26:16 +0000
commit4d4d2d367d9471f9de363f0ca2ed82871e0030d0 (patch)
tree5281cd8b122823b07a0da3d73d1b7dd5592afe3d /sys/netinet/ip_divert.c
parent62616a7acbbd781617169a513e88cc20a5ad44ba (diff)
downloadFreeBSD-src-4d4d2d367d9471f9de363f0ca2ed82871e0030d0.zip
FreeBSD-src-4d4d2d367d9471f9de363f0ca2ed82871e0030d0.tar.gz
Add cr_canseeinpcb() doing checks using the cached socket
credentials from inp_cred which is also available after the socket is gone. Switch cr_canseesocket consumers to cr_canseeinpcb. This removes an extra acquisition of the socket lock. Reviewed by: rwatson MFC after: 3 months (set timer; decide then)
Diffstat (limited to 'sys/netinet/ip_divert.c')
-rw-r--r--sys/netinet/ip_divert.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index aea0d61..bac4534 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -627,7 +627,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS)
inp = LIST_NEXT(inp, inp_list)) {
INP_RLOCK(inp);
if (inp->inp_gencnt <= gencnt &&
- cr_canseesocket(req->td->td_ucred, inp->inp_socket) == 0)
+ cr_canseeinpcb(req->td->td_ucred, inp) == 0)
inp_list[i++] = inp;
INP_RUNLOCK(inp);
}
OpenPOWER on IntegriCloud