summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2002-01-14 03:11:56 +0000
committerNiels Provos <provos@cvs.openbsd.org>2002-01-14 03:11:56 +0000
commit67e6877326ec09684a9203da8452b23c01cd134c (patch)
tree7a6693fc29259e4a89c84caa44de3da5844e14fc /sys/netinet/tcp_subr.c
parent78a5fb6356970c7ff605ff022dbed5521fdca2fa (diff)
use macros to manage tcp timers; based on netbsd
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 26835ef897d..d3a5aeeacbd 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_subr.c,v 1.52 2001/07/21 09:26:06 itojun Exp $ */
+/* $OpenBSD: tcp_subr.c,v 1.53 2002/01/14 03:11:55 provos Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
@@ -446,10 +446,10 @@ tcp_respond(tp, template, m, ack, seq, flags)
* protocol control block.
*/
struct tcpcb *
-tcp_newtcpcb(inp)
- struct inpcb *inp;
+tcp_newtcpcb(struct inpcb *inp)
{
- register struct tcpcb *tp;
+ struct tcpcb *tp;
+ int i;
tp = malloc(sizeof(*tp), M_PCB, M_NOWAIT);
if (tp == NULL)
@@ -458,7 +458,10 @@ tcp_newtcpcb(inp)
LIST_INIT(&tp->segq);
tp->t_maxseg = tcp_mssdflt;
tp->t_maxopd = 0;
-
+
+ for (i = 0; i < TCPT_NTIMERS; i++)
+ TCP_TIMER_INIT(tp, i);
+
#ifdef TCP_SACK
tp->sack_disable = tcp_do_sack ? 0 : 1;
#endif