tcp_timewait.c (112009) | tcp_timewait.c (113345) |
---|---|
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 112009 2003-03-08 22:06:20Z jlemon $ | 34 * $FreeBSD: head/sys/netinet/tcp_timewait.c 113345 2003-04-10 20:33:10Z rwatson $ |
35 */ 36 37#include "opt_compat.h" 38#include "opt_inet6.h" 39#include "opt_ipsec.h" 40#include "opt_mac.h" 41#include "opt_tcpdebug.h" 42 --- 878 unchanged lines hidden (view full) --- 921 if (inp_list == 0) 922 return ENOMEM; 923 924 s = splnet(); 925 INP_INFO_RLOCK(&tcbinfo); 926 for (inp = LIST_FIRST(tcbinfo.listhead), i = 0; inp && i < n; 927 inp = LIST_NEXT(inp, inp_list)) { 928 INP_LOCK(inp); | 35 */ 36 37#include "opt_compat.h" 38#include "opt_inet6.h" 39#include "opt_ipsec.h" 40#include "opt_mac.h" 41#include "opt_tcpdebug.h" 42 --- 878 unchanged lines hidden (view full) --- 921 if (inp_list == 0) 922 return ENOMEM; 923 924 s = splnet(); 925 INP_INFO_RLOCK(&tcbinfo); 926 for (inp = LIST_FIRST(tcbinfo.listhead), i = 0; inp && i < n; 927 inp = LIST_NEXT(inp, inp_list)) { 928 INP_LOCK(inp); |
929 if (inp->inp_gencnt <= gencnt && 930 (((inp->inp_vflag & INP_TIMEWAIT) && 931 cr_cansee(req->td->td_ucred, intotw(inp)->tw_cred) == 0) || 932 cr_canseesocket(req->td->td_ucred, inp->inp_socket) == 0)) 933 inp_list[i++] = inp; | 929 if (inp->inp_gencnt <= gencnt) { 930 /* 931 * XXX: This use of cr_cansee(), introduced with 932 * TCP state changes, is not quite right, but for 933 * now, better than nothing. 934 */ 935 if (inp->inp_vflag & INP_TIMEWAIT) 936 error = cr_cansee(req->td->td_ucred, 937 intotw(inp)->tw_cred); 938 else 939 error = cr_canseesocket(req->td->td_ucred, 940 inp->inp_socket); 941 if (error == 0) 942 inp_list[i++] = inp; 943 } |
934 INP_UNLOCK(inp); 935 } 936 INP_INFO_RUNLOCK(&tcbinfo); 937 splx(s); 938 n = i; 939 940 error = 0; 941 for (i = 0; i < n; i++) { --- 989 unchanged lines hidden --- | 944 INP_UNLOCK(inp); 945 } 946 INP_INFO_RUNLOCK(&tcbinfo); 947 splx(s); 948 n = i; 949 950 error = 0; 951 for (i = 0; i < n; i++) { --- 989 unchanged lines hidden --- |