tcp_timewait.c (90198) | tcp_timewait.c (91354) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 |
34 * $FreeBSD: head/sys/netinet/tcp_timewait.c 90198 2002-02-04 17:37:06Z ume $ | 34 * $FreeBSD: head/sys/netinet/tcp_timewait.c 91354 2002-02-27 04:45:37Z dd $ |
35 */ 36 37#include "opt_compat.h" 38#include "opt_inet6.h" 39#include "opt_ipsec.h" 40#include "opt_tcpdebug.h" 41 42#include <sys/param.h> --- 874 unchanged lines hidden (view full) --- 917 addrs[0].sin_addr, addrs[0].sin_port, 0, NULL); 918 if (inp == NULL || inp->inp_socket == NULL) { 919 error = ENOENT; 920 goto out; 921 } 922 error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred); 923 if (error) 924 goto out; | 35 */ 36 37#include "opt_compat.h" 38#include "opt_inet6.h" 39#include "opt_ipsec.h" 40#include "opt_tcpdebug.h" 41 42#include <sys/param.h> --- 874 unchanged lines hidden (view full) --- 917 addrs[0].sin_addr, addrs[0].sin_port, 0, NULL); 918 if (inp == NULL || inp->inp_socket == NULL) { 919 error = ENOENT; 920 goto out; 921 } 922 error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred); 923 if (error) 924 goto out; |
925 bzero(&xuc, sizeof(xuc)); 926 xuc.cr_uid = inp->inp_socket->so_cred->cr_uid; 927 xuc.cr_ngroups = inp->inp_socket->so_cred->cr_ngroups; 928 bcopy(inp->inp_socket->so_cred->cr_groups, xuc.cr_groups, 929 sizeof(xuc.cr_groups)); | 925 cru2x(inp->inp_socket->so_cred, &xuc); |
930 error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); 931out: 932 splx(s); 933 return (error); 934} 935 936SYSCTL_PROC(_net_inet_tcp, OID_AUTO, getcred, 937 CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, --- 35 unchanged lines hidden (view full) --- 973 0, NULL); 974 if (inp == NULL || inp->inp_socket == NULL) { 975 error = ENOENT; 976 goto out; 977 } 978 error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred); 979 if (error) 980 goto out; | 926 error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); 927out: 928 splx(s); 929 return (error); 930} 931 932SYSCTL_PROC(_net_inet_tcp, OID_AUTO, getcred, 933 CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, --- 35 unchanged lines hidden (view full) --- 969 0, NULL); 970 if (inp == NULL || inp->inp_socket == NULL) { 971 error = ENOENT; 972 goto out; 973 } 974 error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred); 975 if (error) 976 goto out; |
981 bzero(&xuc, sizeof(xuc)); 982 xuc.cr_uid = inp->inp_socket->so_cred->cr_uid; 983 xuc.cr_ngroups = inp->inp_socket->so_cred->cr_ngroups; 984 bcopy(inp->inp_socket->so_cred->cr_groups, xuc.cr_groups, 985 sizeof(xuc.cr_groups)); | 977 cru2x(inp->inp_socket->so_cred, &xuc); |
986 error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); 987out: 988 splx(s); 989 return (error); 990} 991 992SYSCTL_PROC(_net_inet6_tcp6, OID_AUTO, getcred, 993 CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, --- 500 unchanged lines hidden --- | 978 error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); 979out: 980 splx(s); 981 return (error); 982} 983 984SYSCTL_PROC(_net_inet6_tcp6, OID_AUTO, getcred, 985 CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, --- 500 unchanged lines hidden --- |