summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authordd <dd@FreeBSD.org>2002-02-27 04:45:37 +0000
committerdd <dd@FreeBSD.org>2002-02-27 04:45:37 +0000
commitc8a6bd99227ca59b48fafa66f2a21ddb86096d9e (patch)
treeb9bd8d438620748c0c88ed7a994eb55f8d617278 /sys/netinet6
parentd9b95389509535794ad65d022528710a8400e45f (diff)
downloadFreeBSD-src-c8a6bd99227ca59b48fafa66f2a21ddb86096d9e.zip
FreeBSD-src-c8a6bd99227ca59b48fafa66f2a21ddb86096d9e.tar.gz
Introduce a version field to `struct xucred' in place of one of the
spares (the size of the field was changed from u_short to u_int to reflect what it really ends up being). Accordingly, change users of xucred to set and check this field as appropriate. In the kernel, this is being done inside the new cru2x() routine which takes a `struct ucred' and fills out a `struct xucred' according to the former. This also has the pleasant sideaffect of removing some duplicate code. Reviewed by: rwatson
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/udp6_usrreq.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index 09fd898..2861f7f 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -486,11 +486,7 @@ udp6_getcred(SYSCTL_HANDLER_ARGS)
error = ENOENT;
goto out;
}
- bzero(&xuc, sizeof(xuc));
- xuc.cr_uid = inp->inp_socket->so_cred->cr_uid;
- xuc.cr_ngroups = inp->inp_socket->so_cred->cr_ngroups;
- bcopy(inp->inp_socket->so_cred->cr_groups, xuc.cr_groups,
- sizeof(xuc.cr_groups));
+ cru2x(inp->inp_socket->so_cred, &xuc);
error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred));
out:
splx(s);
OpenPOWER on IntegriCloud