Deleted Added
full compact
tcp_timer.c (194305) tcp_timer.c (195699)
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

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

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
30 */
31
32#include <sys/cdefs.h>
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

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

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/netinet/tcp_timer.c 194305 2009-06-16 19:00:48Z jhb $");
33__FBSDID("$FreeBSD: head/sys/netinet/tcp_timer.c 195699 2009-07-14 22:48:30Z rwatson $");
34
35#include "opt_inet6.h"
36#include "opt_tcpdebug.h"
37
38#include <sys/param.h>
39#include <sys/kernel.h>
40#include <sys/lock.h>
41#include <sys/mbuf.h>

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

60#include <netinet/tcp.h>
61#include <netinet/tcp_fsm.h>
62#include <netinet/tcp_timer.h>
63#include <netinet/tcp_var.h>
64#include <netinet/tcpip.h>
65#ifdef TCPDEBUG
66#include <netinet/tcp_debug.h>
67#endif
34
35#include "opt_inet6.h"
36#include "opt_tcpdebug.h"
37
38#include <sys/param.h>
39#include <sys/kernel.h>
40#include <sys/lock.h>
41#include <sys/mbuf.h>

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

60#include <netinet/tcp.h>
61#include <netinet/tcp_fsm.h>
62#include <netinet/tcp_timer.h>
63#include <netinet/tcp_var.h>
64#include <netinet/tcpip.h>
65#ifdef TCPDEBUG
66#include <netinet/tcp_debug.h>
67#endif
68#include <netinet/vinet.h>
69
70int tcp_keepinit;
71SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit, CTLTYPE_INT|CTLFLAG_RW,
72 &tcp_keepinit, 0, sysctl_msec_to_ticks, "I", "time to establish connection");
73
74int tcp_keepidle;
75SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPIDLE, keepidle, CTLTYPE_INT|CTLFLAG_RW,
76 &tcp_keepidle, 0, sysctl_msec_to_ticks, "I", "time before keepalive probes begin");

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

126void
127tcp_slowtimo(void)
128{
129 VNET_ITERATOR_DECL(vnet_iter);
130
131 VNET_LIST_RLOCK();
132 VNET_FOREACH(vnet_iter) {
133 CURVNET_SET(vnet_iter);
68
69int tcp_keepinit;
70SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit, CTLTYPE_INT|CTLFLAG_RW,
71 &tcp_keepinit, 0, sysctl_msec_to_ticks, "I", "time to establish connection");
72
73int tcp_keepidle;
74SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPIDLE, keepidle, CTLTYPE_INT|CTLFLAG_RW,
75 &tcp_keepidle, 0, sysctl_msec_to_ticks, "I", "time before keepalive probes begin");

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

125void
126tcp_slowtimo(void)
127{
128 VNET_ITERATOR_DECL(vnet_iter);
129
130 VNET_LIST_RLOCK();
131 VNET_FOREACH(vnet_iter) {
132 CURVNET_SET(vnet_iter);
134 INIT_VNET_INET(vnet_iter);
135 tcp_maxidle = tcp_keepcnt * tcp_keepintvl;
136 INP_INFO_WLOCK(&V_tcbinfo);
137 (void) tcp_tw_2msl_scan(0);
138 INP_INFO_WUNLOCK(&V_tcbinfo);
139 CURVNET_RESTORE();
140 }
141 VNET_LIST_RUNLOCK();
142}

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

158 */
159
160void
161tcp_timer_delack(void *xtp)
162{
163 struct tcpcb *tp = xtp;
164 struct inpcb *inp;
165 CURVNET_SET(tp->t_vnet);
133 tcp_maxidle = tcp_keepcnt * tcp_keepintvl;
134 INP_INFO_WLOCK(&V_tcbinfo);
135 (void) tcp_tw_2msl_scan(0);
136 INP_INFO_WUNLOCK(&V_tcbinfo);
137 CURVNET_RESTORE();
138 }
139 VNET_LIST_RUNLOCK();
140}

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

156 */
157
158void
159tcp_timer_delack(void *xtp)
160{
161 struct tcpcb *tp = xtp;
162 struct inpcb *inp;
163 CURVNET_SET(tp->t_vnet);
166 INIT_VNET_INET(tp->t_vnet);
167
168 INP_INFO_RLOCK(&V_tcbinfo);
169 inp = tp->t_inpcb;
170 /*
171 * XXXRW: While this assert is in fact correct, bugs in the tcpcb
172 * tear-down mean we need it as a work-around for races between
173 * timers and tcp_discardcb().
174 *

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

198}
199
200void
201tcp_timer_2msl(void *xtp)
202{
203 struct tcpcb *tp = xtp;
204 struct inpcb *inp;
205 CURVNET_SET(tp->t_vnet);
164
165 INP_INFO_RLOCK(&V_tcbinfo);
166 inp = tp->t_inpcb;
167 /*
168 * XXXRW: While this assert is in fact correct, bugs in the tcpcb
169 * tear-down mean we need it as a work-around for races between
170 * timers and tcp_discardcb().
171 *

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

195}
196
197void
198tcp_timer_2msl(void *xtp)
199{
200 struct tcpcb *tp = xtp;
201 struct inpcb *inp;
202 CURVNET_SET(tp->t_vnet);
206 INIT_VNET_INET(tp->t_vnet);
207#ifdef TCPDEBUG
208 int ostate;
209
210 ostate = tp->t_state;
211#endif
212 /*
213 * XXXRW: Does this actually happen?
214 */

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

274
275void
276tcp_timer_keep(void *xtp)
277{
278 struct tcpcb *tp = xtp;
279 struct tcptemp *t_template;
280 struct inpcb *inp;
281 CURVNET_SET(tp->t_vnet);
203#ifdef TCPDEBUG
204 int ostate;
205
206 ostate = tp->t_state;
207#endif
208 /*
209 * XXXRW: Does this actually happen?
210 */

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

270
271void
272tcp_timer_keep(void *xtp)
273{
274 struct tcpcb *tp = xtp;
275 struct tcptemp *t_template;
276 struct inpcb *inp;
277 CURVNET_SET(tp->t_vnet);
282 INIT_VNET_INET(tp->t_vnet);
283#ifdef TCPDEBUG
284 int ostate;
285
286 ostate = tp->t_state;
287#endif
288 INP_INFO_WLOCK(&V_tcbinfo);
289 inp = tp->t_inpcb;
290 /*

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

370}
371
372void
373tcp_timer_persist(void *xtp)
374{
375 struct tcpcb *tp = xtp;
376 struct inpcb *inp;
377 CURVNET_SET(tp->t_vnet);
278#ifdef TCPDEBUG
279 int ostate;
280
281 ostate = tp->t_state;
282#endif
283 INP_INFO_WLOCK(&V_tcbinfo);
284 inp = tp->t_inpcb;
285 /*

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

365}
366
367void
368tcp_timer_persist(void *xtp)
369{
370 struct tcpcb *tp = xtp;
371 struct inpcb *inp;
372 CURVNET_SET(tp->t_vnet);
378 INIT_VNET_INET(tp->t_vnet);
379#ifdef TCPDEBUG
380 int ostate;
381
382 ostate = tp->t_state;
383#endif
384 INP_INFO_WLOCK(&V_tcbinfo);
385 inp = tp->t_inpcb;
386 /*

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

440 CURVNET_RESTORE();
441}
442
443void
444tcp_timer_rexmt(void * xtp)
445{
446 struct tcpcb *tp = xtp;
447 CURVNET_SET(tp->t_vnet);
373#ifdef TCPDEBUG
374 int ostate;
375
376 ostate = tp->t_state;
377#endif
378 INP_INFO_WLOCK(&V_tcbinfo);
379 inp = tp->t_inpcb;
380 /*

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

434 CURVNET_RESTORE();
435}
436
437void
438tcp_timer_rexmt(void * xtp)
439{
440 struct tcpcb *tp = xtp;
441 CURVNET_SET(tp->t_vnet);
448 INIT_VNET_INET(tp->t_vnet);
449 int rexmt;
450 int headlocked;
451 struct inpcb *inp;
452#ifdef TCPDEBUG
453 int ostate;
454
455 ostate = tp->t_state;
456#endif

--- 212 unchanged lines hidden ---
442 int rexmt;
443 int headlocked;
444 struct inpcb *inp;
445#ifdef TCPDEBUG
446 int ostate;
447
448 ostate = tp->t_state;
449#endif

--- 212 unchanged lines hidden ---