tcp_timewait.c (75733) | tcp_timewait.c (77843) |
---|---|
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 75733 2001-04-20 11:58:56Z jesper $ | 34 * $FreeBSD: head/sys/netinet/tcp_timewait.c 77843 2001-06-06 22:17:08Z peter $ |
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> --- 132 unchanged lines hidden (view full) --- 175#undef ALIGNM1 176 177/* 178 * Tcp initialization 179 */ 180void 181tcp_init() 182{ | 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> --- 132 unchanged lines hidden (view full) --- 175#undef ALIGNM1 176 177/* 178 * Tcp initialization 179 */ 180void 181tcp_init() 182{ |
183 int hashsize; | 183 int hashsize = TCBHASHSIZE; |
184 185 tcp_ccgen = 1; 186 tcp_cleartaocache(); 187 188 tcp_delacktime = TCPTV_DELACK; 189 tcp_keepinit = TCPTV_KEEP_INIT; 190 tcp_keepidle = TCPTV_KEEP_IDLE; 191 tcp_keepintvl = TCPTV_KEEPINTVL; 192 tcp_maxpersistidle = TCPTV_KEEP_IDLE; 193 tcp_msl = TCPTV_MSL; 194 195 LIST_INIT(&tcb); 196 tcbinfo.listhead = &tcb; | 184 185 tcp_ccgen = 1; 186 tcp_cleartaocache(); 187 188 tcp_delacktime = TCPTV_DELACK; 189 tcp_keepinit = TCPTV_KEEP_INIT; 190 tcp_keepidle = TCPTV_KEEP_IDLE; 191 tcp_keepintvl = TCPTV_KEEPINTVL; 192 tcp_maxpersistidle = TCPTV_KEEP_IDLE; 193 tcp_msl = TCPTV_MSL; 194 195 LIST_INIT(&tcb); 196 tcbinfo.listhead = &tcb; |
197 TUNABLE_INT_FETCH("net.inet.tcp.tcbhashsize", TCBHASHSIZE, hashsize); | 197 TUNABLE_INT_FETCH("net.inet.tcp.tcbhashsize", &hashsize); |
198 if (!powerof2(hashsize)) { 199 printf("WARNING: TCB hash size not a power of 2\n"); 200 hashsize = 512; /* safe default */ 201 } 202 tcp_tcbhashsize = hashsize; 203 tcbinfo.hashbase = hashinit(hashsize, M_PCB, &tcbinfo.hashmask); 204 tcbinfo.porthashbase = hashinit(hashsize, M_PCB, 205 &tcbinfo.porthashmask); --- 1219 unchanged lines hidden --- | 198 if (!powerof2(hashsize)) { 199 printf("WARNING: TCB hash size not a power of 2\n"); 200 hashsize = 512; /* safe default */ 201 } 202 tcp_tcbhashsize = hashsize; 203 tcbinfo.hashbase = hashinit(hashsize, M_PCB, &tcbinfo.hashmask); 204 tcbinfo.porthashbase = hashinit(hashsize, M_PCB, 205 &tcbinfo.porthashmask); --- 1219 unchanged lines hidden --- |