summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_timer.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2007-05-16 17:14:25 +0000
committerandre <andre@FreeBSD.org>2007-05-16 17:14:25 +0000
commitdb8bfe6922eb4d1e975e9ca2491c3a1c41b6bf63 (patch)
tree03cd6fefea329aac65e210ceed95cfe3d6c8667a /sys/netinet/tcp_timer.c
parente9ba2ca930b8546703a252333142ac306f699c8e (diff)
downloadFreeBSD-src-db8bfe6922eb4d1e975e9ca2491c3a1c41b6bf63.zip
FreeBSD-src-db8bfe6922eb4d1e975e9ca2491c3a1c41b6bf63.tar.gz
Move TIME_WAIT related functions and timer handling from files
other than repo copied tcp_subr.c into tcp_timewait.c#1.284: tcp_input.c#1.350 tcp_timewait() -> tcp_twcheck() tcp_timer.c#1.92 tcp_timer_2msl_reset() -> tcp_tw_2msl_reset() tcp_timer.c#1.92 tcp_timer_2msl_stop() -> tcp_tw_2msl_stop() tcp_timer.c#1.92 tcp_timer_2msl_tw() -> tcp_tw_2msl_scan() This is a mechanical move with appropriate renames and making them static if used only locally. The tcp_tw_2msl_scan() cleanup function is still run from the tcp_slowtimo() in tcp_timer.c.
Diffstat (limited to 'sys/netinet/tcp_timer.c')
-rw-r--r--sys/netinet/tcp_timer.c55
1 files changed, 1 insertions, 54 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index dd380b7..c3c816c 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -133,7 +133,7 @@ tcp_slowtimo(void)
tcp_maxidle = tcp_keepcnt * tcp_keepintvl;
INP_INFO_WLOCK(&tcbinfo);
- (void) tcp_timer_2msl_tw(0);
+ (void) tcp_tw_2msl_scan(0);
INP_INFO_WUNLOCK(&tcbinfo);
}
@@ -468,59 +468,6 @@ tcp_timer_2msl(struct tcpcb *tp, struct inpcb *inp)
return (0);
}
-/*
- * The timed wait queue contains references to each of the TCP sessions
- * currently in the TIME_WAIT state. The queue pointers, including the
- * queue pointers in each tcptw structure, are protected using the global
- * tcbinfo lock, which must be held over queue iteration and modification.
- */
-static TAILQ_HEAD(, tcptw) twq_2msl;
-
-void
-tcp_timer_init(void)
-{
-
- TAILQ_INIT(&twq_2msl);
-}
-
-void
-tcp_timer_2msl_reset(struct tcptw *tw, int rearm)
-{
-
- INP_INFO_WLOCK_ASSERT(&tcbinfo);
- INP_LOCK_ASSERT(tw->tw_inpcb);
- if (rearm)
- TAILQ_REMOVE(&twq_2msl, tw, tw_2msl);
- tw->tw_time = ticks + 2 * tcp_msl;
- TAILQ_INSERT_TAIL(&twq_2msl, tw, tw_2msl);
-}
-
-void
-tcp_timer_2msl_stop(struct tcptw *tw)
-{
-
- INP_INFO_WLOCK_ASSERT(&tcbinfo);
- TAILQ_REMOVE(&twq_2msl, tw, tw_2msl);
-}
-
-struct tcptw *
-tcp_timer_2msl_tw(int reuse)
-{
- struct tcptw *tw;
-
- INP_INFO_WLOCK_ASSERT(&tcbinfo);
- for (;;) {
- tw = TAILQ_FIRST(&twq_2msl);
- if (tw == NULL || (!reuse && tw->tw_time > ticks))
- break;
- INP_LOCK(tw->tw_inpcb);
- tcp_twclose(tw, reuse);
- if (reuse)
- return (tw);
- }
- return (NULL);
-}
-
static int
tcp_timer_keep(struct tcpcb *tp, struct inpcb *inp)
{
OpenPOWER on IntegriCloud