summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-06-27 11:35:53 +0000
committerpjd <pjd@FreeBSD.org>2006-06-27 11:35:53 +0000
commit7f09680f0c87e3fa5b79fafb2016eb337dd35779 (patch)
treea0df08bb1fe778e4df12a8e3d98c6ee7b968e52c /sys/netinet6
parent97382ba992b2246952e73a36460bcdfbb32f1c02 (diff)
downloadFreeBSD-src-7f09680f0c87e3fa5b79fafb2016eb337dd35779.zip
FreeBSD-src-7f09680f0c87e3fa5b79fafb2016eb337dd35779.tar.gz
- Use suser_cred(9) instead of directly checking cr_uid.
- Change the order of conditions to first verify that we actually need to check for privileges and then eventually check them. Reviewed by: rwatson
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6_pcb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index e83d043..37809eb 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -192,8 +192,8 @@ in6_pcbbind(inp, nam, cred)
ntohs(lport) >= ipport_reservedlow &&
suser_cred(cred, SUSER_ALLOWJAIL))
return (EACCES);
- if (so->so_cred->cr_uid != 0 &&
- !IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) {
+ if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr) &&
+ suser_cred(so->so_cred, SUSER_ALLOWJAIL) != 0) {
t = in6_pcblookup_local(pcbinfo,
&sin6->sin6_addr, lport,
INPLOOKUP_WILDCARD);
OpenPOWER on IntegriCloud