tcp_subr.c (d1745f454d6a3e5f1d181741f067a2da31466797) tcp_subr.c (81930014ef2caa3b69ed663b695976aa4ee7b34d)
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

--- 166 unchanged lines hidden (view full) ---

175#undef ALIGNM1
176
177/*
178 * Tcp initialization
179 */
180void
181tcp_init()
182{
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

--- 166 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 ---